You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by th...@se.abb.com on 2003/05/16 10:14:49 UTC

[HTTPClient] - Http response

Hi everybody!

I'm trying to receive a custom status (customer demand). It looks like this
HTTP/1.0 420 Some text.

When my response contains two line feeds "\n\n" everything works well, but
when my response ends with "\r\n" (i.e. HTTP/1.0 420 Some text\r\n) the
http client hangs.

Isn't the correct ending \r\n?

I'm running the alpha2 on windows.

Thanks in advance,

/Theis.



Re: [HTTPClient] - Http response

Posted by Erik Mattsson <er...@imbridge.com>.
Hmmm. the status line ( "HTTP/1.0 420 somtext" ) must be ended
by "\r\n" and then comes the headers, each ends with "\r\n". 
After all headers you must output "\r\n" to tell the client that
there are no more headers coming, and that the body is coming.

if you dont have any headers then the reply looks like
"HTTP/1.0 420 somtext\r\n\r\n"

the client probably hangs because it is waiting for the
headers which are never coming.

//erik


----- Original Message ----- 
From: <th...@se.abb.com>
To: <co...@jakarta.apache.org>
Sent: Friday, May 16, 2003 10:14 AM
Subject: [HTTPClient] - Http response


> Hi everybody!
> 
> I'm trying to receive a custom status (customer demand). It looks like this
> HTTP/1.0 420 Some text.
> 
> When my response contains two line feeds "\n\n" everything works well, but
> when my response ends with "\r\n" (i.e. HTTP/1.0 420 Some text\r\n) the
> http client hangs.
> 
> Isn't the correct ending \r\n?
> 
> I'm running the alpha2 on windows.
> 
> Thanks in advance,
> 
> /Theis.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org