curl: add --follow

Makes curl follow redirects an act on the response code and change a
custom method accordingly, contrary to --location.

Potential future command line to send QUERY and following a redirect
according to the status code:

    curl -d "request-body" -X QUERY --follow https://example.com

add test 794,796,797

Assisted-by: Daniel Böhmer <post@daniel-boehmer.de>

Closes #16543
This commit is contained in:
Daniel Stenberg 2025-04-25 13:09:00 +02:00
parent 29a6e15b27
commit 13cbabf05f
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
16 changed files with 340 additions and 10 deletions

View file

@ -90,6 +90,7 @@ typedef enum {
C_FAIL_EARLY,
C_FAIL_WITH_BODY,
C_FALSE_START,
C_FOLLOW,
C_FORM,
C_FORM_ESCAPE,
C_FORM_STRING,