curl-users
Re: How to POST to the last redirect page
Date: Fri, 8 Jun 2007 16:35:38 -0700
On Sat, Jun 09, 2007 at 07:02:17AM +0800, Bin Chen wrote:
> Thanks for your reply, but a little confuse for me. The process should
> be that, I input a URL to the AP and it returns a HTTP REDIRECT
> message, curl can get this redirect URL and try to POST to it. How
> does this make relation to cookie? I think I can make a shell script
> to do curl twice, first to get the redirect address, second to POST to
> it. Because I know it is only one redirect will be issued, so the
> script should be simple.
>
> I ask here is because maybe there is a direct and simple way for curl
> to do this, not necessary to use script.
Sure, use the --location option. But for backward compatibility, curl
does a GET on the relocated address instead of a POST. But are you sure
that's what happens to a browser? Usually the original URL contain a
form that points to another URL where the POST actually takes place, and
no HTTP-level redirect occurs.
>>> Dan
-- http://www.MoveAnnouncer.com The web change of address service Let webmasters know that your web site has movedReceived on 2007-06-09