cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: "POST" option related question using cURL.

From: Suhas Tembe <stembe_at_att.net>
Date: Mon, 20 Oct 2003 14:03:50 -0400

Ok, this is what I tried for the 1st step:

1). I first recorded the cookies as:
curl -D cook.txt http://supplyweb.trw.com/supplyweb/general/default.asp

*** The cook.txt file looks like this: ***
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Date: Mon, 20 Oct 2003 17:52:28 GMT
Content-Length: 8588
Content-Type: text/html; Charset=ISO-8859-1
Set-Cookie: ASPSESSIONIDSCATSRQA=OELBLAKDICKAKNEHBLIFOJBO; path=/
Cache-control: private
***
2). I then decided to use the cook.txt & post as:

curl -b cook.txt -d "UserAccount=USER&AccessCode=PASSWORD&Locale=en-us&TimeZone=PST%3A-480&action-Submit=Login" http://supplyweb.trw.com/supplyweb/general/default.asp

This doesn't seem to have worked, because I see the default.asp page being scrolled. How do I know that I am logged-in? Am I doing something wrong?

The next step I would like to do after I "log in" is do a GET using: http://supplyweb.trw.com/InventoryStatus.asp?cboSupplier=SUPPLIERNUM&status=all&action-select=Query

Any help is appreciated.

Thanks again.
Suhas

---- Original Message -----
From: "Daniel Stenberg" <daniel_at_haxx.se>
To: "Curl Mailinglist" <curl-users_at_lists.sourceforge.net>
Sent: Wednesday, October 15, 2003 4:04 AM
Subject: Re: "POST" option related question using cURL.

> On Tue, 14 Oct 2003, Suhas Tembe wrote:
>
> > I have a question related to the POST option & maybe you guys can help. I am
> > trying to obtain the "source" of a web page & let me tell you what I do
> > using Internet Explorer. There are two steps involved:
> > 1). Log in to the customer's web site. http://supplyweb.trw.com After I type-in this address in IE & hit enter, it automatically changes to:
http://supplyweb.trw.com/supplyweb/general/default.asp. This is the login screen where I type-in the user name, password, etc. & hit "Login".
> > 2). Once I am logged-in, I execute the following link: http://supplyweb.trw.com/InventoryStatus.asp?cboSupplier=SUPPLIERNUM&status=all&action-select=Query
that brings-up the page I want. This works when using IE.
>
> > I am trying to work with the 1st step & eventually use curl, but am stuck.
> > When I look at the "form" tags in the source, I can see that the "action" is
> > ="../General/SupplyWeb.asp" (and not "default.asp" ??). Anyway, I formed
> > this link:
> >
> > http://supplyweb.trw.com/supplyweb/General/SupplyWeb.asp?UserAccount=USER&AccessCode=PASSWORD&Locale=en-us&TimeZone=PST%3A-480&action-Submit=Login
>
> Even in the subject of the mail you used the word POST. You don't POST by
> filling in all the data in the URL. That only makes a GET request, and this
> form specificly says POST.
>
> Try POST instead: pass on all the data using -d.
>
> The site uses cookies, so you should probably do too. Also, there's an amount
> of javascript in there that might do something weird, I didn't really look
> closely enough to see.
>
> --
> Daniel Stenberg -- curl: been grokking URLs since 1998
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: SF.net Giveback Program.
> SourceForge.net hosts over 70,000 Open Source Projects.
> See the people who have HELPED US provide better services:
> Click here: http://sourceforge.net/supporters.php

-------------------------------------------------------
This SF.net email sponsored by: Enterprise Linux Forum Conference & Expo
The Event For Linux Datacenter Solutions & Strategies in The Enterprise
Linux in the Boardroom; in the Front Office; & in the Server Room
http://www.enterpriselinuxforum.com
Received on 2003-10-20