cURL / Mailing Lists / curl-users / Single Mail


Re: POST data goes into second packet.

From: Daniel Stenberg <>
Date: Mon, 12 May 2003 13:36:11 +0200 (CEST)

On Mon, 12 May 2003, Kaye-Smith Adam wrote:

> I am trying to replicate what occurs when I logon on to a website through a
> browser.
> With curl I am using the -d to post the variables and -H to changes headers
> values & this works as expected but when I monitor what packets are
> exchanged (via the ethereal network analyser) when the browser provides its
> posted values, the browser puts its variables in a packet that is seperate
> to the initial post packet. ie the Host:, User-agent:, Accept: headers are
> in the first http packet & the next http packet has just the postdata & the
> headers Type: & Size. I am not sure if this critical to why my curl based
> form entry is not working but how do I get curl to emulate the browser by
> defining exactly what goes in what packets in the initial POST sequemce (
> which includes a second packet as stated above).

I doubt it very much, this is the reason for your script's failure.

You can't emulate the browser's behavior to that level with curl. The only
valid reason I can think of, would be if the remote server is utterly stupid
imlemented and can't be fixed.

One way to try it out, would be to setup a proxy in between and let curl
operate through that one, as it'll change how the packets are sent out from
the proxy to the remote server.

 Daniel Stenberg -- curl: been grokking URLs since 1998
Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
The only event dedicated to issues related to Linux enterprise solutions
Received on 2003-05-12