You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by ergodic 7 <er...@yahoo.com> on 2005/01/31 12:35:08 UTC

Tutorial question

In the
tutorial:http://jakarta.apache.org/commons/httpclient/tutorial.html
 
it is stated that "the response body is always read
regardless of the status returned by the server".

What is the reason for this. If this is not done what
are the implications?

=====
Regards,
Leonardo Pierre


		
__________________________________ 
Do you Yahoo!? 
Read only the mail you want - Yahoo! Mail SpamGuard. 
http://promotions.yahoo.com/new_mail 

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


Re: Tutorial question

Posted by Roland Weber <RO...@de.ibm.com>.
ergodic 7 <er...@yahoo.com> wrote on 31.01.2005 14:42:27:

> If the server returns a 404 error must the response
> still be complete read prior to reuse?

Yes, sure. Most error returns come with a small HTML
error page that must be skipped. The end of the current
response always has to be found before re-using the
connection, and reading until the end is the only way
to do that.

But it is not the application's responsibility to read
the response body if it is not interested. HttpClient
will automatically read the rest of the response when
the connection is released, if I'm not mistaken.

cheers,
  Roland

Re: Tutorial question

Posted by ergodic 7 <er...@yahoo.com>.
If the server returns a 404 error must the response
still be complete read prior to reuse?

--- Roland Weber <RO...@de.ibm.com> wrote:

> Hello Leonardo,
> 
> > it is stated that "the response body is always
> read
> > regardless of the status returned by the server".
> > 
> > What is the reason for this. If this is not done
> what
> > are the implications?
> > 
> A connection cannot be re-used for another request
> until the response has been read completely.
> 
> cheers,
>   Roland
> 


=====
Regards,
Leonardo Pierre


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Helps protect you from nasty viruses. 
http://promotions.yahoo.com/new_mail

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


Re: Tutorial question

Posted by Roland Weber <RO...@de.ibm.com>.
Hello Leonardo,

> it is stated that "the response body is always read
> regardless of the status returned by the server".
> 
> What is the reason for this. If this is not done what
> are the implications?
> 
A connection cannot be re-used for another request
until the response has been read completely.

cheers,
  Roland