HTTP/1.1 500 Internal Server Error Get while webpage works Java
HTTP/1.1 500 Internal Server Error Get while webpage works Java
我想和
一起工作
HttpResponse httpResponse = httpClient.execute(method, context);
并收到此错误
HttpResponseProxy{HTTP/1.1 500 Internal Server Error [Date: Mon, 23 Nov 2015 08:30:11 GMT,
Server: Apache/2.2.20 (Ubuntu), X-Powered-By: PHP/5.3.6-13ubuntu3.8, Set-Cookie:
PHPSESSID=gtr71sg82bm9gd9987qeu9gp50; path=/, Expires: Thu, 19 Nov 1981 08:52:00 GMT,
Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
pre-check=0, Pragma: no-cache, Keep-Alive: timeout=5, max=100,
Connection: Keep-Alive, Transfer-Encoding: chunked, Content-Type: application/json; charset=utf-8]}
该网页在网络浏览器中显示为文本,并显示有效的 Json 文本(全部在一行中)
但在船尾使用 (f12) 我也收到错误 500 .
我无法检查服务器错误,因为它不是我的。
我已经搜索过像我这样的以前的错误,发现:this and
和 that one 以及更多
他们都提供改变 header
已尝试更改 header - 但它并没有解决我的问题。
我怎么知道我需要哪个 header?
我还能尝试如何修复它?
更多详情
Response Headers
view source
Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection:Keep-Alive
Content-Type:application/json; charset=utf-8
Date:Wed, 25 Nov 2015 09:46:41 GMT
Expires:Thu, 19 Nov 1981 08:52:00 GMT
Keep-Alive:timeout=5, max=100
Pragma:no-cache
Server:Apache/2.2.20 (Ubuntu)
Transfer-Encoding:chunked
X-Powered-By:PHP/5.3.6-13ubuntu3.8
Request Headers
view source
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding:gzip, deflate, sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Cookie:PHPSESSID=gb9n33a3qbnlqfdnn6kretsgr3
Host:cc.avidtrak.com
Upgrade-Insecure-Requests:1
User-Agent:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36
这不是实际答案,因为我无法发表评论,但您可以尝试打开开发工具(Chrome 中的 f12)并打开网络选项卡,请求 url 并查看请求 headers (因为你说它适用于浏览器请求),并与你从 Java
发出的请求进行比较
HttpResponse httpResponse = httpClient.execute(method, context);
并收到此错误
HttpResponseProxy{HTTP/1.1 500 Internal Server Error [Date: Mon, 23 Nov 2015 08:30:11 GMT,
Server: Apache/2.2.20 (Ubuntu), X-Powered-By: PHP/5.3.6-13ubuntu3.8, Set-Cookie:
PHPSESSID=gtr71sg82bm9gd9987qeu9gp50; path=/, Expires: Thu, 19 Nov 1981 08:52:00 GMT,
Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
pre-check=0, Pragma: no-cache, Keep-Alive: timeout=5, max=100,
Connection: Keep-Alive, Transfer-Encoding: chunked, Content-Type: application/json; charset=utf-8]}
该网页在网络浏览器中显示为文本,并显示有效的 Json 文本(全部在一行中) 但在船尾使用 (f12) 我也收到错误 500 .
我无法检查服务器错误,因为它不是我的。
我已经搜索过像我这样的以前的错误,发现:this and
他们都提供改变 header 已尝试更改 header - 但它并没有解决我的问题。
我怎么知道我需要哪个 header? 我还能尝试如何修复它?
更多详情
Response Headers
view source
Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection:Keep-Alive
Content-Type:application/json; charset=utf-8
Date:Wed, 25 Nov 2015 09:46:41 GMT
Expires:Thu, 19 Nov 1981 08:52:00 GMT
Keep-Alive:timeout=5, max=100
Pragma:no-cache
Server:Apache/2.2.20 (Ubuntu)
Transfer-Encoding:chunked
X-Powered-By:PHP/5.3.6-13ubuntu3.8
Request Headers
view source
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding:gzip, deflate, sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Cookie:PHPSESSID=gb9n33a3qbnlqfdnn6kretsgr3
Host:cc.avidtrak.com
Upgrade-Insecure-Requests:1
User-Agent:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36
这不是实际答案,因为我无法发表评论,但您可以尝试打开开发工具(Chrome 中的 f12)并打开网络选项卡,请求 url 并查看请求 headers (因为你说它适用于浏览器请求),并与你从 Java
发出的请求进行比较