On Apr 5, 2007, at 13:38, Frans van Daalen wrote:
> The first postasync generate 302 from the server. As follow is set the
> httpcli will also do a get for the relocation.
What do you mean that it will do a Get for the relocation? A 302
relocation response just means that you have to request the resource at
a different location. The relocation target should be returned as the
body on the 302 response from the server. Also keep in mind that
submitting a Get request instead of a Post may not work properly if the
server expects a Post request. I say this because you mention that you
start with PostAsync.
> after processing of the result of that relocation
> the second postasync to the same server will generate again 302,
> follow is
> set.
Of course, if you re-request to the original location that caused the
302 response, you will get the same response. Or perhaps I didn't
understand your problem?
> This time in the code I see the response "bad request". In the sniffer
> I will however see the 302 (as expected) but there is no additional
> get to
> relocate send out by the software.
If I understand your problem, what is happening is this: You submit a
Post request, the server responds with 302, the HttpCli automatically
submits a Get request to the new location, but the server rejected it,
ignored it, or processed it incorrectly because it was expecting a Post
request: With a Post request, the server will receive the data in the
request body; while with a Get request it will receive it in the
"query-string", which is in the request header.
I haven't used HttpCli in years, so I don't know how the "follow"
mechanism works, but if it only performs Get requests, then you must
not set "follow", and perform the redirection using a new PostAsync
request to the new location.
dZ.
--
DZ-Jay [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be