cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Redirect from POST to GET

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 3 Mar 2015 09:53:26 +0100 (CET)

On Tue, 3 Mar 2015, Alexander Henket wrote:

> Yes. Is there another way to do the initial POST?
>
> The command for initial upload:
>
> curl -v -L -X POST -F file=@bundletest.xml
> http://${user}:${pass}@${base}/ValueSet

Your use of -X here will make it send POST on subsequent requests as well,
which then is probably not what you want. So just remove "-X POST" from your
command line and you'll be fine. -F implies POST on its own.

This is explained like this in the manual:

   The the method string you set with -X will be used for all requests, which
   if you for example use -L, --location may cause unintended side-effects
   when curl doesn't change request method according to the HTTP 30x response
   codes - and similar.

-- 
  / 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 2015-03-03