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.
Follow a PATCH/DELETE redirect response with GET method
- Contemporary messages sorted: [ by date ] [ by thread ] [ by subject ] [ by author ] [ by messages with attachments ]
From: Matthew Radford via curl-users <curl-users_at_lists.haxx.se>
Date: Wed, 18 Jan 2023 21:59:41 +0000
curl 7.87.1-DEV (x86_64-pc-linux-gnu) libcurl/7.87.1-DEV OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9
Release-Date: [unreleased]
OS: Ubuntu 22.04
There doesn't appear to be command line options to imply/coerce PATCH/DELETE methods, like you can for GET/HEAD/POST/PUT:
```
Option | Implies Method
--------------------|----------------------
default, --get | GET
--head | HEAD
--data | POST
--form | POST
--upload-file | PUT
? | PATCH
? | DELETE
```
The reason I ask is that I'd like to follow a 302/303 redirect response Location with a GET request after PATCH/DELETE, but using `--request|-X PATCH|DELETE` forces PATCH/DELETE on the redirect. I can expand on details with my particular use case and why following redirects with GET from PATCH/DELETE is desirable, if that's helpful.
Is it possible for curl to make a PATCH/DELETE HTTP request and follow a 302/303 redirect response Location using GET? If not, would new command line option(s) to imply/coerce the method be acceptable?
Thanks,
Matt
Date: Wed, 18 Jan 2023 21:59:41 +0000
curl 7.87.1-DEV (x86_64-pc-linux-gnu) libcurl/7.87.1-DEV OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9
Release-Date: [unreleased]
OS: Ubuntu 22.04
There doesn't appear to be command line options to imply/coerce PATCH/DELETE methods, like you can for GET/HEAD/POST/PUT:
```
Option | Implies Method
--------------------|----------------------
default, --get | GET
--head | HEAD
--data | POST
--form | POST
--upload-file | PUT
? | PATCH
? | DELETE
```
The reason I ask is that I'd like to follow a 302/303 redirect response Location with a GET request after PATCH/DELETE, but using `--request|-X PATCH|DELETE` forces PATCH/DELETE on the redirect. I can expand on details with my particular use case and why following redirects with GET from PATCH/DELETE is desirable, if that's helpful.
Is it possible for curl to make a PATCH/DELETE HTTP request and follow a 302/303 redirect response Location using GET? If not, would new command line option(s) to imply/coerce the method be acceptable?
Thanks,
Matt
-- Unsubscribe: https://lists.haxx.se/listinfo/curl-users Etiquette: https://curl.se/mail/etiquette.htmlReceived on 2023-01-19