curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: curl follow location method

From: Daniel Stenberg via curl-users <curl-users_at_lists.haxx.se>
Date: Mon, 10 Jul 2023 20:11:54 +0200 (CEST)

On Mon, 10 Jul 2023, jicea via curl-users wrote:

> For status code 301, 302 or 303, curl should switch to GET if I send a POST
> request with a "Location" header. I want to test it with a simple Flask
> endpoint, and I got this :

Let me first mention two blog posts of mine on related topics:

  HTTP Redirects =>
    https://daniel.haxx.se/blog/2016/02/18/http-redirects/

  Unnecessary use of curl -X =>
    https://daniel.haxx.se/blog/2015/09/11/unnecessary-use-of-curl-x/

> $ curl --verbose --request POST --location 'http://localhost:8000/follow-redirect'

Now you can read that second blog post and ponder about your use of "--request
POST" in this command line! ;-)

-- 
  / daniel.haxx.se
  | Commercial curl support up to 24x7 is available!
  | Private help, bug fixes, support, ports, new features
  | https://curl.se/support.html
-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-users
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2023-07-10