hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ittay Dror <ittay.d...@gmail.com>
Subject Re: getting NoHttpResponseException("The target server failed to respond")
Date Tue, 04 Jan 2011 15:30:06 GMT
It turns out this is because my warmupInput file was empty. The server 
responded with 100 (continue), but because the file was empty nothing 
was written to the output stream, so after a while there was a timeout.

IMHO, this is a bug. Either an empty input should be posted, or I should 
get a more accurate error ("nothing to post")

Ittay

Ittay Dror wrote:
> Hello
>
> I'm trying to send a POST request to "http://localhost:8090/my/path", 
> and getting the exception in the subject.
>
> The request goes to a the same process.
> The servlet handling requests is jersey's ServletContainer.
> Requests from an external tool (both to http://localhost:8090/my/path 
> and http://localhost:8090) are fine.
> Putting a breakpoint in the servlet shows it is not called
>
> I create the request like:
>       var httpClient = new DefaultHttpClient
>
>       var httpPost = new HttpPost((new URL(base, requestUrl)).toString)
>       httpPost.addHeader("Content-Type", "text/raw")
>       httpPost.setEntity(new InputStreamEntity(warmupInput.openStream, 
> -1))
>       var response = httpClient.execute(httpPost)
>
> What can be the problem?
>
> Regards,
> Ittay

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message