cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Post www-urlencoded data

From: What you get is Not what you see <wyginwys_at_gmail.com>
Date: Mon, 25 Feb 2008 10:24:47 +0200

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.
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.
Here are the headers
POST /url HTTP/1.1
Host: url
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 5.1; FDM;
.NET CLR 1.1.4322)
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.7,tr;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: some url
100K thing is a _VIEWSTATE variable posted by form which I extract it from
a previous curl transaction.
I overlooked -F option. There is no submit buttons on the form.
Instead the post is done by javascript in a custom ASP.Net's way.
Should I use -F option?

On Fri, Feb 22, 2008 at 11:52 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:
> On Fri, 22 Feb 2008, What you get is Not what you see wrote:
>
> > I am using curl curl 7.16.4.
>
> > I need to post some data of 100000+ chars.
>
>
> > I use "curl options --data @postfile http://url" syntax from
> > commandline where the options are
>
> [...]
>
>
> > But it seems that there is something wrong because the server doesnt accept
> > the request. What do you suggest?
>
> I suggest you tell us more details about the request and the response. Does
> curl send exactly what you told it to? If it did, can you please tell us how
> this is a curl issue in the first place?
>
> 100K is very large for a plain normal POST, are you sure you shouldn't use -F
> ?
>
> --
> Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
>
Received on 2008-02-25