cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Form Post FindByCity

From: bruce <badouglas_at_gmail.com>
Date: Fri, 20 May 2011 13:11:05 -0700

when using curl to follow a "302", you need to use a "-L" in the cmd

curl -L -A user-agent http:/gggg

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
>
> Any help would be appreciated.
> -------------------------------------------------------------------
> 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.html
>

-------------------------------------------------------------------
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.html
Received on 2011-05-20