无法识别Http请求标头“Accept-Charset”

时间:2013-11-29 07:20:36

标签: http rest http-headers jetty google-chrome-app

我正在尝试使用chrome DHC和Advanced rest客户端进行REST调用。例如:

HEAD致电http://www.google.co.in  使用高级REST客户端提供:

Redirect To:https://www.google.co.in/ with status: 302 Show explanation HTTP/1.1 302 Found
Redirection information has not been cached.
Location: https://www.google.co.in/ 
Cache-Control: private 
Content-Type: text/html; charset=UTF-8 
Date: Fri, 29 Nov 2013 06:57:46 GMT 
Server: gws 
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Alternate-Protocol: 80:quic
Content-Length: 222 
Proxy-Connection: Keep-Alive
Connection: Keep-Alive
Status
200 OK Show explanation Loading time: 764


Request headers 
Accept: application/json
Accept-Language: en-US
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57 Safari/537.36
X-Chrome-Variations: <some value>
Accept-Encoding: gzip,deflate,sdch
Cookie: <some value>

Response headers 
status: 200 OK
version: HTTP/1.1
alternate-protocol: 443:quic
cache-control: private, max-age=0
content-encoding: gzip
content-length: 34821
content-type: text/html; charset=UTF-8
date: Fri, 29 Nov 2013 06:57:46 GMT
expires: -1
server: gws
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block

我对请求标头的详细信息更感兴趣,因为“Accept-Charset”无法识别。如果我提供任何标题,它至少会显示在请求标题中。现在有些问题:

  1. 为什么不承认?这是客户端问题还是服务器问题?我需要使用任何其他客户端。我不知道。

  2. 如果它被识别,那么我应该能够在服务器代码中验证这个值,在我的情况下是在jetty中运行吗?

  3. 谢谢, Akhi

1 个答案:

答案 0 :(得分:0)

我发现它是一个特定于Chrome的客户端问题。我不知道为什么使用chrome这个标题完全被忽略了。 当我尝试使用 CURL 命令发送http请求时,我能够检索此标头。现在我可以继续验证“Accept-Charset”标题。

相关问题