cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Redirect from POST to GET

From: Alexander Henket <ahenket_at_xs4all.nl>
Date: Tue, 3 Mar 2015 23:37:28 +0100

Indeed like you said. Thanks for explaining.

Alexander

> Op 3 mrt. 2015, om 09:53 heeft Daniel Stenberg <daniel_at_haxx.se> het volgende geschreven:
>
> 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

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