curl-users
Re: Problems downloading .asp files
Date: Thu, 19 Jul 2001 08:10:36 -0700
My earlier post didn't tell the whole story. The way you suggest doing
it was they way I was doing it at first. One difference though, I was using
double quotes instead of single quotes as it is below. I tried single quotes
but curl didn't seem to like it.
Since I couldn't get it to work, I thought the -d parameter was the way to
go especially since it worked for PCQuote. But when I tried, as you suggest,
curl -o test.pge "http://www.cboe.com/MktQuote/DelayedQuotes.asp?TICKER=OEX&PAGE=1&ALL=2&bRunQuery=true"
I get the following error message:
<head><title>Object moved</title></head>
<body><h1>Object Moved</h1>This object may be found here.</body>
And thanks for all of your help. I do appreciate your giving attention to a curl "newbie".
Ron Schoenberg
rons_at_cablespeed.com
At 01:14 PM 7/19/01 +1000, you wrote:
>You are confusing the use of GET and POST parameters - input to web
>applications can be in either form - its up to the application to decide
>what it wants.
>
>'-d' sends a POST paramter as input, but your example URLS show the use
>of GET parameters:
>
>> I'm trying to read web pages with financial data. I have no problem if it's
>> a .php file. The URL reads
>>
>> http://www.pcquote.com/options/stringget.php?ticker=OEX&THEORETICALS=1&RANGE=999&SHOW=1&FIRSTMONTH=0&MONTHS=2
>>
>> and when I type
>>
>> curl -o test.pge http://www.pcquote.com/options/stringget.php -d ticker=OEX -d THEORETICALS=1 -d RANGE=999 -d SHOW=1 -d FIRSTMONTH=0 -d MONTHS=2
>>
>> the page downloads nicely.
>
>This curl command is *NOT* accessing the URL you gave in the example -
>its accessing only 'stringget.php', and passing the PHP parameters in
>the body of the request. The curl command which accesses the url you
>gave as an example would be:
>
>curl -o test.pge
>'http://www.pcquote.com/options/stringget.php?ticker=OEX&THEORETICALS=1&RANGE=999&SHOW=1&FIRSTMONTH=0&MONTHS=2'
>
>(The quotes are to protect the '&' characters, which are special to the
>shell).
>
>Luckily for you, PHP deliberately accepts both POST and GET input and
>treats it the same, so the .php page works either way. (A security
>misfeature, but hey...) Unluckily for you, ASP doesn't do this - it
>keeps POST and GET parameters separate. The ASP page you are accessing
>is looking only for GET parameters, and you didn't send any.
>
>> However, when I try the OEX page at CBOE (which is really the definitive page) it doesn't work. The
>> URL is
>>
>> http://www.cboe.com/MktQuote/DelayedQuotes.asp?TICKER=OEX&PAGE=1&ALL=1&bRunQuery=true
>>
>> and when I type
>>
>> curl -o test.pge http://www.cboe.com/MktQuote/DelayedQuotes.asp -d TICKER=OEX -dPAGE=1 -d ALL=1 -d bRunQuery=true
>>
>> I get the following error message:
>...
>
>Ask for exactly what you want:
>
>curl -o test.pge
>'http://www.cboe.com/MktQuote/DelayedQuotes.asp?TICKER=OEX&PAGE=1&ALL=1&bRunQuery=true'
>
>and you should get it...
>
>Cris
Received on 2001-07-19