curl-users
Re: Form Post FindByCity
Date: Fri, 20 May 2011 14:40:44 -0600
At 13:11 -0700 5/20/11, bruce wrote:
>when using curl to follow a "302", you need to use a "-L" in the cmd
>
>curl -L -A user-agent http:/gggg
For the record, will the curl tool automatically pick up the cookies, especially the session ID that was sent as a part of the 302 error?
And, what about the added "?execution=e1s1" GET information? Otherwise the redirected address is identical to the original. Will curl add it automatically?
And the original posting, unfortunately top-posted over.
>
>On Fri, May 20, 2011 at 10:33 AM, Dejan Tolj <dejan1_at_gmail.com> wrote:
>> I am trying to write a curl script to fill out a form from canada
>> post: http://www.canadapost.ca/cpotools/apps/fpc/business/findByCity
>> and make it return a valid Postal code for the specified street name, city.
>>
>> Here is my script:
>> curl --form "fpcByAdvancedSearch:fpcSearch:streetNumber=435&streetName=Main&city=Toronto&fpcByAdvancedSearch:fpcSearch:province=ON"
>> --user-agent "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"
>> http://www.canadapost.ca/cpotools/apps/fpc/business/findByCity
>>
>> However I am always getting a bunch of 302 moved Temporarily errors:
>> HTTP/1.0 302 Moved Temporarily
>> Server: Sun-Java-System-Web-Server/7.0
>> Date: Fri, 20 May 2011 15:19:04 GMT
>> X-powered-by: Servlet/2.5 JSP/2.1
>> Set-Cookie: CPO_SSID_UI=R358069258; path=/
>> Set-Cookie: CPO_JSESSIONID=yyv7NWGL8lvCsQt2Vj93FkwhFQxLFGNT2vmlvT6TrQ0Jyy9vb48N!-1828250336;
>> path=/
>> Cache-Control: no-cache
>> Cache-Control: no-store
>> Pragma: no-cache
>> Location: http://www.canadapost.ca/cpotools/apps/fpc/business/findByCity?execution=e1s1
>> Expires: Thu, 01 Jan 1970 00:00:00 GMT
>> Proxy-agent: Sun-Java-System-Web-Server/7.0
>> X-Cache: MISS from 10.224.135.86
>> Via: 1.1 https-canadapost, 1.0 10.224.135.86 (squid/3.0.STABLE19)
>> Proxy-Connection: close
-- 1801 - Joseph Marie Jacquard uses punch cards to instruct a loom to weave "hello, world" into a tapestry. ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-users FAQ: http://curl.haxx.se/docs/faq.html Etiquette: http://curl.haxx.se/mail/etiquette.htmlReceived on 2011-05-20