cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Form Post FindByCity

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 20 May 2011 22:46:40 +0200 (CEST)

On Fri, 20 May 2011, Doug McNutt wrote:

>> 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?

If you activated the "cookie engine" (with -b or -c), it will.

> And, what about the added "?execution=e1s1" GET information? Otherwise the
> redirected address is identical to the original. Will curl add it
> automatically?

curl will use the Location: header to go to. As that header has the added
"?execution=e1s1" part the next request will use that.

A little caveat to consider is if you do POST and then let curl follow a
redirect on a 301 or 302 response as that's a bit ambiguous. The original HTTP
standard says it should send a post in the subsequent request as well but
browsers never did but always switched to GET instead so that's what curl does
as well - unless you use --post301 or --post302 to instead force curl to obey
the spec and do a POST again.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
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