Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法在java中读取/检索非标准/自定义HTTP头_Http - Fatal编程技术网

无法在java中读取/检索非标准/自定义HTTP头

无法在java中读取/检索非标准/自定义HTTP头,http,Http,我使用getAllHeaders()(HttpClient Java API)访问响应头,但我只能看到以下标准头 Date = Mon, 08 Jun 2015 06:57:31 GMT Server = Apache Pragma = no-cache Cache-Control = no-cache, no-store Expires = Wed, 31 Dec 1969 19:00:00 EST Content-Type = text/html;charset=UTF-8 我无法从HTT

我使用getAllHeaders()(HttpClient Java API)访问响应头,但我只能看到以下标准头

Date = Mon, 08 Jun 2015 06:57:31 GMT
Server = Apache
Pragma = no-cache
Cache-Control = no-cache, no-store
Expires = Wed, 31 Dec 1969 19:00:00 EST
Content-Type = text/html;charset=UTF-8
我无法从HTTP响应中读取或查看自定义头,如userAuthToken。 请建议从http响应中读取或检索非标准或自定义头的方法。
提前感谢

标准头areContent Length=1293 Keep Alive=timeout=15,max=100 Connection=Keep Alive X-Powered-By=Servlet 2.5;JBoss-5.0/JBossWeb-2.1 Accept Ranges=bytes ETag=W/“17094-143202910000”Last Modified=Wed,2015年5月20日06:21:50 GMTT尝试添加代码示例,以使您的问题更清楚地说明您的尝试。另外,如果存在读取http头的任何异常,我将使用以下链接中的代码,但使用给定的代码,我只能从http响应中读取标准http头,而不能读取非标准http头(例如自定义头pqr=asjjajsjah)。读取非标准HTTP头的任何代码或帮助都会很有帮助。标准头是内容长度=1293保持活动=超时=15,最大连接=100保持活动X-Powered-By=Servlet 2.5;JBoss-5.0/JBossWeb-2.1 Accept Ranges=bytes ETag=W/“17094-143202910000”Last Modified=Wed,2015年5月20日06:21:50 GMTT尝试添加代码示例,以使您的问题更清楚地说明您的尝试。另外,如果存在读取http头的任何异常,我将使用以下链接中的代码,但使用给定的代码,我只能从http响应中读取标准http头,而不能读取非标准http头(例如自定义头pqr=asjjajsjah)。读取非标准HTTP头的任何代码或帮助都会很有帮助。标准头是内容长度=1293保持活动=超时=15,最大连接=100保持活动X-Powered-By=Servlet 2.5;JBoss-5.0/JBossWeb-2.1 Accept Ranges=bytes ETag=W/“17094-143202910000”Last Modified=Wed,2015年5月20日06:21:50 GMTT尝试添加代码示例,以使您的问题更清楚地说明您的尝试。另外,如果存在读取http头的任何异常,我将使用以下链接中的代码,但使用给定的代码,我只能从http响应中读取标准http头,而不能读取非标准http头(例如自定义头pqr=asjjajsjah)。阅读非标准HTTP头的任何代码或帮助都会很有帮助。