cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Easy "POST" question but cannot figure it out!!

From: <jon_at_linertia.com>
Date: Wed, 14 Nov 2007 15:38:46 -0800 (PST)

Thanks Daniel,

I got the output from LiveHTTPHeaders and it was this:

GET /forum/login/
POST /forum/login/ email=email%40email.com&password=pass&login=Log+in

that's exactly what I'm sending it as the data in my curl command line.

curl -c cookie -d "email=email%40email.com&password=pass&login=Log+in"
http://www.example.com/forum/login

What I put above does not work. HOWEVER, I took the cookie information
from my manual login (which i did through firefox) and copied that
information into "cookie" and when I logged in, it worked. What's the
deal here? Obviously I'm not giving it the credentials it wants via curl.
  Is it possible that a server prevents curl requests?

Thanks again!

> On Wed, 14 Nov 2007, jon_at_linertia.com wrote:
>
>> I have read that already, twice over. It is obvious that I read it
>> based on
>> the methods I have used to fix the problem. Any suggestions?
>
> Yes, Use LiveHTTPHeaders, clear your cookies then run your operation
> manually
> once and log everything with LiveHTTPHeaders.
>
> Then inspect the log and repeat those requests with curl. Pay attention to
> cookies and the exact data sent in the POST.
>
> --
> Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
>
Received on 2007-11-15