cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Problems using cURL

From: Erdmut Pfeifer <e.pfeifer_at_science-computing.de>
Date: Sun, 8 Apr 2001 14:01:04 +0200

On Sat, Apr 07, 2001 at 09:14:58PM -0700, Dan Dickerson wrote:
> I am trying to mimic the use of a form:
> http://www.usps.gov/ncsc/lookups/lookup_zip+4.html
>
> I am using cURL ver. 7.7.1 on a WindowsME system. I invoke it with:
> curl -K curl.txt http://www.usps.com/cgi-bin/zip4/zip4inq2
>
> curl.txt is a text file with the following contents:
> -o addout.html
> -A "Mozilla/4.76 [en] (Win95; U)"
> -e "http://www.usps.gov/ncsc/lookups/lookup_zip+4.html"
> -d "City=&Zip%20Code=91104&Delivery%20Address=1800%20N%20Sierra%20Bonita%20Ave.&Firm=&State=&Submit=Process&Urbanization="
>
> When I run this I get the response from the server that the State is incorrect,
> but when I enter the data from the form, it works just fine. Putting in a valid
> state does not fix the problem. Furthermore, when entered from the form, putting
> in an invalid state does not cause problems if the Zip exists.

occasionally, you'll come across some badly written CGI scripts that
rely on a fixed ordering of fields in the query string...
I just tried that hypothesis with your data above -- seems to the case
here, too. So if you specify the fields in the order they appear in the
form, i.e.

"Firm=&Urbanization=&Delivery+Address=1800+N+Sierra+Bonita+Ave.&City=&State=&Zip+Code=91104&Submit=Process"

things seem to work fine...

Cheers,
Erdmut

-- 
Erdmut Pfeifer
science+computing ag
-- Bugs come in through open windows. Keep Windows shut! --
Received on 2001-04-08