hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Weber <ossf...@dubioso.net>
Subject Re: [help] how to set an OutputStream to a POST request?
Date Sat, 08 Mar 2008 08:13:30 GMT
Hello Micky,

you log shows...

a) a POST request header, with content length set and
    a header for the expect-continue handshake
b) NO reply to the expect-continue handshake,
    for whatever reason
c) a second POST request header, identical to the first one

This is still alpha code. Maybe a,b,c are just a case
of bad logging and there is really only one POST request
being sent.

d) the server replies with a 302 Redirect, trying to
    set a cookie and to rewrite the URL to include the
    session ID in case cookies are not supported

If you have a look at the Client HTTP Programming Primer,
you will find that it tells you to establish a session
BEFORE posting data:
http://wiki.apache.org/HttpComponents/ForAbsoluteBeginners

The only purpose of the redirect is obviously to
get the session ID to your client application.
You did not establish a session, that's why you
are getting a redirect.

e) HttpClient automatically follows the redirect with
    a GET request. That is the expected behavior, since
    the data has been POSTed before and must not be sent
    to the redirect location without user interaction.

Your servlet is receiving only the second request,
which doesn't have any POST data because it's a GET.

hope that helps,
   Roland

---------------------------------------------------------------------
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