cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: redirect

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 17 Aug 2000 18:29:10 +0200 (MET DST)

On Thu, 17 Aug 2000, Filip Hanik wrote:

> I was under the impression that the -L would simple try to post to the
> new URL, that is not what I want.

Curl 7.1 does not do that. It only does a POST on the intial request and then
it converts to GET in the following request(s).

Curl versions before 7.0.8beta works as you desribe.

> 1. I do a post to login script
> 2. the script validates my username and password
> 3. If authentication comes through fine the web server returns a redirect
> 4. the browser executes a GET on that redirect
>
> in step 4 (with -L) curl attempts to do a POST on the redirect, hence an
> error gets thrown saying this page doesn't allow POST
>
> any ideas?

If curl wouldn't do this, you'd be left to script it yourself: Do the POST,
parse the output headers, do the GET, read the page.

-- 
      Daniel Stenberg - http://daniel.haxx.se - +46-705-44 31 77
   ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`ol
Received on 2000-08-17