I know you had issues opened with this kind of title, and people were using -X PUT to force PUT, but not this time.
I did this
touch somefile.txt
curl -T 'somefile.txt' -v -L https://httpstat.us/301 > /dev/null
( as adviced here : #578 (comment) )
I expected the following
curl should send somefile.txt with a PUT request, then follow the 303 redirect with a GET request. Instead it uses the PUT verb.
Issue does not occur when server returns a 301 or 302 redirect.
If it isn't the right way to send a put request and follow a 303 response, I'm sorry to have bothered you, and would be glad to know how to do that ! 🙂
Output of the command
(some tls and progress bar logs have been redacted for readability)
* Trying 23.99.0.12:443...
* Connected to httpstat.us (23.99.0.12) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
> PUT /301 HTTP/1.1
> Host: httpstat.us
> User-Agent: curl/7.69.1
> Accept: */*
> Content-Length: 0
>
< HTTP/1.1 301 Moved Permanently
< Cache-Control: private
< Content-Length: 21
< Content-Type: text/plain; charset=utf-8
< Location: https://httpstat.us
< Server: Microsoft-IIS/10.0
< X-AspNetMvc-Version: 5.1
< Access-Control-Allow-Origin: *
< X-AspNet-Version: 4.0.30319
< Request-Context: appId=cid-v1:7585021b-2db7-4da6-abff-2cf23005f0a9
< Access-Control-Expose-Headers: Request-Context
< X-Powered-By: ASP.NET
< Set-Cookie: ARRAffinity=dc9bb7185987c0d65790987c33534f3a4e8956d9544852ccf290ce45876d7754;Path=/;HttpOnly;Domain=httpstat.us
< Date: Tue, 14 Apr 2020 17:16:50 GMT
<
* Ignoring the response-body
* Connection #0 to host httpstat.us left intact
* Issue another request to this URL: 'https://httpstat.us/'
* Found bundle for host httpstat.us: 0x55e7f74485c0 [serially]
* Can not multiplex, even if we wanted to!
* Re-using existing connection! (#0) with host httpstat.us
* Connected to httpstat.us (23.99.0.12) port 443 (#0)
> PUT / HTTP/1.1
> Host: httpstat.us
> User-Agent: curl/7.69.1
> Accept: */*
> Content-Length: 0
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Cache-Control: private
< Content-Length: 8553
< Content-Type: text/html; charset=utf-8
< Server: Microsoft-IIS/10.0
< X-AspNetMvc-Version: 5.1
< Access-Control-Allow-Origin: *
< X-AspNet-Version: 4.0.30319
< Request-Context: appId=cid-v1:7585021b-2db7-4da6-abff-2cf23005f0a9
< Access-Control-Expose-Headers: Request-Context
< X-Powered-By: ASP.NET
< Set-Cookie: ARRAffinity=dc9bb7185987c0d65790987c33534f3a4e8956d9544852ccf290ce45876d7754;Path=/;HttpOnly;Domain=httpstat.us
< Date: Tue, 14 Apr 2020 17:16:50 GMT
<
* Connection #0 to host httpstat.us left intact
curl/libcurl version
curl 7.69.1 (x86_64-pc-linux-gnu) libcurl/7.69.1 OpenSSL/1.1.1f zlib/1.2.11 libidn2/2.3.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh2/1.9.0 nghttp2/1.40.0
Release-Date: 2020-03-11
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets
operating system
Linux arceus 5.4.30-1-MANJARO #1 SMP PREEMPT Thu Apr 2 17:31:45 UTC 2020 x86_64 GNU/Linux
I know you had issues opened with this kind of title, and people were using
-X PUTto force PUT, but not this time.I did this
touch somefile.txtcurl -T 'somefile.txt' -v -L https://httpstat.us/301 > /dev/null( as adviced here : #578 (comment) )
I expected the following
curl should send somefile.txt with a PUT request, then follow the 303 redirect with a GET request. Instead it uses the PUT verb.
Issue does not occur when server returns a 301 or 302 redirect.
If it isn't the right way to send a put request and follow a 303 response, I'm sorry to have bothered you, and would be glad to know how to do that ! 🙂
Output of the command
(some tls and progress bar logs have been redacted for readability)
curl/libcurl version
curl 7.69.1 (x86_64-pc-linux-gnu) libcurl/7.69.1 OpenSSL/1.1.1f zlib/1.2.11 libidn2/2.3.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh2/1.9.0 nghttp2/1.40.0
Release-Date: 2020-03-11
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets
operating system
Linux arceus 5.4.30-1-MANJARO #1 SMP PREEMPT Thu Apr 2 17:31:45 UTC 2020 x86_64 GNU/Linux