cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Post www-urlencoded data

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 25 Feb 2008 10:51:55 +0100 (CET)

On Mon, 25 Feb 2008, What you get is Not what you see wrote:

Please don't top-post, it makes it very hard to follow this thread in mail and
in the web archives.

> I am not sure if curl is sending what i expect because I use --data @file
> option and I am confused with the format of it. Also I dont know how to
> check if curl sends the correct data if it is different than the --trace
> option.

--trace and --trace-ascii should help you see exactly what curl sends as then
you can verify that it matches what you expected it to send.

> Now I use --data @file option and some headers and a cookie jar to post a
> form's data. The file's structure is like that
> prm1=urlencodeddata&prm2=urlencodeddata... this file has no newline
> characters. I suppose curl puts correct Content-type, content-length headers
> when posts.

Yes it does. If curl sends the wrong data, I can only assume that you did the
URL encoding wrong, possibly by encoding the &-separators too or similar.
Also, --data-binary might be more suitable for you.

> I overlooked -F option. There is no submit buttons on the form.

-F has no particular relation to a submit button or not.

> Instead the post is done by javascript in a custom ASP.Net's way.

Neither does it matter if the post is done by javascript when a browser does
this.

> Should I use -F option?

It depends entirely on what you want to send. Since you mentioned &-separators
you probably don't want -F.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2008-02-25