A机器向B机器发送请求,在B机器上抓包的数据如下
POST /eReadTPF/service?action=getDRMProductTicket HTTP/1.1
Host: 192.168.0.138:8080
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: zh-cn,ar-ae;q=0.7,zh;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: GB2312,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Content-Type: application/xml
Content-Length: 217
Device-info: model=N95&screen=320*240&engine_id=Symbian3th_huaweiWidget
X-Client-Agent: eReading_Device_T62/1.0.0.1
X-User-Hash: 8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92
X-Device-Hash: 9f0251769213f4bf8173fada0ccff89f5e8c0010ac9f7d77c9f60da20a95f4f0
X-Device-Id: 162219151134783985400000001064
X-Screen-Size: 600*800
X-User-Account: 13602550508
X-Api-Version: 1.1.2
X-User-Agent: Huawei_T62
Pragma: no-cache
Cache-Control: no-cache
但是在B机器通过下面的代码
HttpServletRequest request = ServletActionContext.getRequest();
        Enumeration<String> en = request.getHeaderNames();
        while(en.hasMoreElements())
        {
            System.out.println(en.nextElement());
        }
打印HtptpServletRequest的消息头发现里面的消息头全变成小写了
accept-encoding
x-device-hash
x-screen-size
connection
accept-charset
pragma
content-type
x-user-agent
keep-alive
x-client-agent
device-info
x-device-id
content-length
x-api-version
x-user-hash
cache-control
x-user-account
host
accept-language
user-agent
accept
这样导致在取消息头时String deviceId = request.getHeader("X-Device-Id");取到的为空,容器用的是tomcat5.5,请教下为什么消息头会自动的变成小写呢