curl-users
Working with http://www.usps.com
Date: Tue, 27 May 2003 07:24:36 -0400
Hi Everyone,
I am working with the USPS's page at http://www.usps.com/zip4/.
Essentially, I am trying to submit an address and have it return the zip
+ 4 code for US addresses. It posts to a JSP page as you'll see.
Here's what I do:
curl -o z41.html -b z4_cookies.txt -c z4_cookies.txt -A "Mozilla" -L
http://www.usps.com/zip4/welcome.htm
and it gives me the page with the form to enter the addresses. Now
formfind.pl does not much care for evaluating the html, but it does
evaluate it to an extent and I went through and picked the rest of the
elements of the form out myself.
From the UNIX command line: perl formfind.pl < z41.html
<<snip>>
Selection
address1
address2
city
state
zipcode
<<snip>>
So submitting something like:
curl -o z42.html -b z4_cookies.txt -c z4_cookies.txt -A "Mozilla" -L -d
"Selection=1&address1=101%20North%20Riverside&address2=122&city=pompano%
20beach&state=FL&zipcode=33062"
http://www.usps.com/zip4/zip4_response.jsp
will yield an error every time:
<HTML><HEAD><TITLE>Server Error</TITLE></HEAD>
<BODY><H1>Server Error</H1>
This server has encountered an internal error which prevents it from
fulfilling your request. The most likely cause is a misconfigur
ation. Please ask the administrator to look for messages in the server's
error log.
</BODY></HTML>
I am wondering if anyone has worked with this site/page and what he or
she did to work the the jsp page and get this to work.
I am on curl 7.10.3 (i686-pc-linux-gnu) libcurl/7.10.3 OpenSSL/0.9.6
zlib/1.1.3 on a cobalt RAQ 550.
At the outset, is there something I am blatantly missing?
Thank you in advance for your advice and comments.
Daniel F. Reimann
-------------------------------------------------------
This SF.net email is sponsored by: ObjectStore.
If flattening out C++ or Java code to make your application fit in a
relational database is painful, don't do it! Check out ObjectStore.
Now part of Progress Software. http://www.objectstore.net/sourceforge
Received on 2003-05-27