0

enter image description hereI 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 .

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
Community
  • 1
  • 1
2Big2BeSmall
  • 1,348
  • 3
  • 20
  • 40

1 Answers1

1

This is not an actual answer since I cannot comment, but you can try open dev tool (f12 in Chrome) and open network tab, request to the url and see the request headers (since you said it works with browser request), and compare with the request you make from Java

Dan Le
  • 308
  • 2
  • 10