cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: problem with post https

From: Ralph Mitchell <ralphmitchell_at_gmail.com>
Date: Wed, 23 Nov 2011 11:25:02 -0500

On Wed, Nov 23, 2011 at 11:13 AM, mierdatutis mi <mmm286_at_gmail.com> wrote:

> Hi Ralph,
>
> Many thanks for your help.
>
> I can't understand you. The URL: https://www.sportstracklive.com/logindoesn't exists
>
> ------------------------------------------------------------------------------------------------------------
>
>
Yep, you're right - my mistake. I was looking at the form tag:

         <form method="post" name="login">

and reading "action" instead of "name". You should still go download the
signin page before trying to post to it, so you get the session cookie
first.

Ralph Mitchell

>
> > You should do a get first, saving the session cookie, then post the
> login.
> > That's how your browser would do it. Also, try posting to the login page,
> > not the signin page, because that's where the signin form wants you to
> go:
>
> > curl -s -S -L -b cookies -c cookie -o siginin.html
> > https://www.sportstracklive.com/signin
>
> > curl -s -S -L b cookies -c cookies -o login.html
> > -d userCredentialsForm.userCredentials.email=USERNAME
> > -d userCredentialsForm.userCredentials.password=PASSWORD -d
> _target1=Login
> > https://www.sportstracklive.com/login
>
> > You *may* still need to send the user-agent string and the referrer, but
> > mostly I've managed to get away without.
>
> > Ralph Mitchell
>
> -------------------------------------------------------------
> Date: Wed, 23 Nov 2011 10:56:28 +0100
> From: mierda tuti <mierdatuti_at_gmail.com>
> To: the curl tool <curl-users_at_cool.haxx.se>
> Subject: Re: problem with post https
> Message-ID:
> <CAN7OBaRCFdYxOs+7JFvYiz4Pt3y4H1khe1mQ6AboGRtwLs0=JQ_at_mail.gmail.com
> >
> Content-Type: text/plain; charset="utf-8"
>
>
> Thanks again Dan
>
> I fix the User-Agent string and the Referer. I look for hidden fields but I
> don't find nothing. In Live HTTP Headers I see:
> https://www.sportstracklive.com/signin
> *
> POST /signin HTTP/1.1
> Host: www.sportstracklive.com
> User-Agent: Mozilla/5.0 (X11; U; Linux i686; es-ES; rv:1.9.2.3)
> Gecko/20100423 Ubuntu/10.04 (lucid) Firefox/3.6.3
> Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
> Accept-Language: es-es,es;q=0.8,en-us;q=0.5,en;q=0.3
> Accept-Encoding: gzip,deflate
> Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
> Keep-Alive: 115
> Connection: keep-alive
> Referer: https://www.sportstracklive.com/signin
> Cookie: JSESSIONID=FCDA2111841AE860F261B315634BBE84;
> __utma=213534422.2013686047.1322041324.1322041324.1322041324.1;
> __utmb=213534422.1.10.1322041324; __utmc=213534422;
>
> __utmz=213534422.1322041324.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)
> Content-Type: application/x-www-form-urlencoded
> Content-Length: 132
> userCredentialsForm.userCredentials.email=username%40gmail.com
> &userCredentialsForm.userCredentials.password=PASSWORD&_target1=Login
> HTTP/1.1 302 Moved Temporarily
> Date: Wed, 23 Nov 2011 09:45:07 GMT
> Server: Apache/2.2.17 (CentOS)
> Pragma: No-cache
> Expires: Thu, 01 Jan 1970 00:00:00 GMT
> Cache-Control: no-cache, no-store
> Location: https://www.sportstracklive.com/user/username
> Content-Language: es-ES
> Content-Length: 0
> Connection: close
> Content-Type: text/plain; charset=UTF-8*
>
>
> I don't know what can I do.
> Please...
>
>
>
>
> 2011/11/22 Dan Fandrich <dan_at_coneharvesters.com>
>
> > On Tue, Nov 22, 2011 at 10:05:33AM +0100, mierda tuti wrote:
> > > Many thanks Dan,
> > > I'm trying to see with Live HTTP Headers and I thing that I do
> > everything ok.
> >
> > "Everything"? At the very least, the User-Agent string doesn't match any
> > known browser, and there's no Referer: header, so it can't be exact.
> > Does the _target1 field contain any digits when a browser sends it? Are
> > there any hidden fields being sent by a browser that aren't being sent
> > by curl? These may seem minor, but you can't overlook them. Please do
> read
> > the HTTP scripting page I referred to.
> >
> > >>> Dan
> > -------------------------------------------------------------------
> > List admin: http://cool.haxx.se/list/listinfo/curl-users
> > FAQ: http://curl.haxx.se/docs/faq.html
> > Etiquette: http://curl.haxx.se/mail/etiquette.html
> >
> -------------- next part --------------
>
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-users
> FAQ: http://curl.haxx.se/docs/faq.html
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-11-23