Skip to content

--follow doesn't respect 303 method change unless --data also present #20715

@thedanbob

Description

@thedanbob

I did this

curl --request <VERB> --follow http://some/url/that/returns/303

I expected the following

Curl to follow the redirect using GET. Instead, the redirect is followed with the original method.

The redirect is correctly changed to GET if curl is called with empty --data:

curl --request <VERB> --data '' --follow http://some/url/that/returns/303

but I wouldn't expect that to be necessary and it's not documented.

The issue presents with all HTTP verbs, including the ones that don't have dedicated flags (e.g. DELETE).

curl/libcurl version

curl 8.18.0 (x86_64-pc-linux-gnu) libcurl/8.18.0 OpenSSL/3.6.1 zlib/1.3.2 brotli/1.2.0 zstd/1.5.7 libidn2/2.3.8 libpsl/0.21.5 libssh2/1.11.1 nghttp2/1.68.0 ngtcp2/1.20.0 nghttp3/1.15.0 mit-krb5/1.21.3
Release-Date: 2026-01-07
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTP3 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM PSL SPNEGO SSL threadsafe TLS-SRP UnixSockets zstd

operating system

Linux linux-dra 6.12.74-1-lts #1 SMP PREEMPT_DYNAMIC Thu, 19 Feb 2026 16:48:19 +0000 x86_64 GNU/Linux

(Arch linux)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions