cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: How to POST to the last redirect page

From: Bin Chen <binary.chen_at_gmail.com>
Date: Sat, 9 Jun 2007 07:52:51 +0800

I am sure that the POST URL and the web page URL is the same, the form
is submitted to itself.
I think GET is ok too, need a try.

Thanks!

On 6/9/07, Dan Fandrich <dan_at_coneharvesters.com> wrote:
> 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 moved
>
Received on 2007-06-09