curl-users
Re: curl command based on Live HTTP Headers
Date: Fri, 13 Feb 2009 23:47:40 -0800
Thank you very much for the quick reply. I took your advice and tried the
commands you suggested but the downloaded file, berkeleyapp.html, is just
the login page with the following message: "You have been idle for too
long. Please login in."
On Fri, Feb 13, 2009 at 11:26 PM, Ralph Mitchell <ralphmitchell_at_gmail.com>wrote:
> On Sat, Feb 14, 2009 at 12:48 AM, Jason Davidson <jad658_at_gmail.com> wrote:
>
>> Hi, I'm brand new to curl and I'm trying to figure out how to use curl
>> from the command line to login to
>> https://students.berkeley.edu/myberkeley/myberkeleyapp.asp. I installed
>> Live HTTP Headers and I recorded the headers but I don't know how to take
>> this information and apply it to curl. Using the HTTP headers below, can
>> anyone point me in the right direction? Thanks.
>>
>>
>> https://students.berkeley.edu/myberkeley/myberkeleyapp.asp
>>
>> POST /myberkeley/myberkeleyapp.asp HTTP/1.1
>> Host: students.berkeley.edu
>> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.6)
>> Gecko/2009011913 Firefox/3.0.6
>> Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
>> Accept-Language: en-us,en;q=0.5
>> Accept-Encoding: gzip,deflate
>> Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
>> Keep-Alive: 300
>> Connection: keep-alive
>> Referer: https://students.berkeley.edu/myberkeley/myberkeleyapp.asp
>> Cookie: %5FCookieCheck=1;
>> __utma=41573937.4015967032478062000.1234417485.1234417485.1234417485.1;
>> __utmz=41573937.1234417485.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none);
>> ASPSESSIONIDQCCDSTCA=GLPLABPCGKCNBOODIAKIGCDJ;
>> ASPSESSIONIDCCATDTCB=NIHOOPPCHIBGLDPBGLEAJDKF
>> Content-Type: application/x-www-form-urlencoded
>> Content-Length: 95
>>
>> secUserID=USERID&defaultsecUserID=+&secPassword=PASSWORD&secsubmit=Submit&secSessionID=+
>> HTTP/1.x 200 OK
>> Date: Sat, 14 Feb 2009 06:39:40 GMT
>> Server: Microsoft-IIS/6.0
>> X-Powered-By: ASP.NET
>> P3P: CP='NOI NID TAIa OUR NOR STA'
>> Content-Length: 6630
>> Content-Type: text/html
>> Cache-Control: private
>
>
> You should probably start with something like:
>
> curl -s -S -L -b cookies -c cookies -o home.html
> https://students.berkeley.edu/<https://students.berkeley.edu/myberkeley/myberkeleyapp.asp>
> curl -s -S -L -b cookies -c cookies -o berkeleyapp.html -d secUserID=USERID
> -d defaultsecUserID= -d secPassword=PASSWORD -d secsubmit=Submit -d
> secSessionID= https://students.berkeley.edu/myberkeley/myberkeleyapp.asp
> <https://students.berkeley.edu/myberkeley/myberkeleyapp.asp>
>
> You'd want to go to the home page first to get cookies started, *then* go
> to the app page.
>
> Ralph Mitchell
>
>
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
> FAQ: http://curl.haxx.se/docs/faq.html
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>
>
-- Jason Davidson
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-02-14