First you'll want to do the socket input stream i/o manually rather than a string. Seems like 2 possibilities: - the conversion to a string is blowing out the jvm; - the server is sending nothing in the http response body; You should also dump the http response headers. One of them will help out quite a bit: content-length If that is zero...you're assured that the problem is at the server.
The "500" code and a "status" message are separate from the http response body. What did the http response headers say? ...Pete (w) 206-318-5933 (c) 206-914-4134 Starbucks Coffee Company 2401 Utah Ave S. Seattle, WA. 98134 >-----Original Message----- >From: tarini [mailto:[email protected]] >Sent: Saturday, March 27, 2010 11:48 AM >To: [email protected] >Subject: reading body of error-500 response > > >Hi guys, >I'm debugging a web applications that returns a 500 error code response >(with errors explanation in its body) if some parameters are missing. >How can I read its body? >I get an empty HttpEntity -.- > >I tried different way but the results are always the same > >here my list try: > >public class MyResponseHandler implements ResponseHandler<String> { > > @Override > public String handleResponse(HttpResponse response) throws >ClientProtocolException, > IOException { > HttpEntity e = response.getEntity(); > return EntityUtils.toString(e); > } > >} > >thanks :) >-- >View this message in context: http://old.nabble.com/reading-body-of-error- >500-response-tp28054394p28054394.html >Sent from the HttpClient-User mailing list archive at Nabble.com. > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [email protected] >For additional commands, e-mail: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
