[英]HTTP/1.1 500 Internal Server Error Get while webpage works Java
I am tring to work with
我正在努力与
HttpResponse httpResponse = httpClient.execute(method, context);
and getting this error 并得到这个错误
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]}
The webpage appears as text a web browser and showing a valid Json text (all in one line) but aftet using (f12) i also get an error 500 . 该网页在网络浏览器中以文本形式显示,并显示有效的Json文本(全部显示在一行中),但使用(f12)却未正确显示,我也会收到错误500。
I cant check the server error because its not mine. 我无法检查服务器错误,因为它不是我的。
I had search for previous error like mine and found : this and this and that one and many more 我不得不寻找以前的错误,如矿山,并发现: 这个和这个和那一个 ,还有更多
All of them are offering changing the header have tried changing the header - but it didn't solved my problem. 他们所有人都提供了更改标头的方法,并尝试更改标头-但这并没有解决我的问题。
How do i know which header do i need ? 我怎么知道我需要哪个头? What else could i try to fix it ?
我还能尝试解决什么问题?
more details 更多细节
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请求并查看请求标头(因为您说它可以与浏览器请求一起使用),然后进行比较从Java发出的请求
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.