CURLOPT_POSTREDIR: also allow 303 to do POST on the redirected URL

As it turns out, some people do want that after all.
This commit is contained in:
Andrei Cipu
2012-03-30 10:40:04 +03:00
committed by Daniel Stenberg
parent a0b3535735
commit 0b516b7162
6 changed files with 23 additions and 17 deletions

View File

@@ -1180,12 +1180,13 @@ Setting the limit to 0 will make libcurl refuse any redirect. Set it to -1 for
an infinite number of redirects (which is the default)
.IP CURLOPT_POSTREDIR
Pass a bitmask to control how libcurl acts on redirects after POSTs that get a
301 or 302 response back. A parameter with bit 0 set (value
301, 302 or 303 response back. A parameter with bit 0 set (value
\fBCURL_REDIR_POST_301\fP) tells the library to respect RFC 2616/10.3.2 and
not convert POST requests into GET requests when following a 301
redirection. Setting bit 1 (value CURL_REDIR_POST_302) makes libcurl maintain
the request method after a 302 redirect. CURL_REDIR_POST_ALL is a convenience
define that sets both bits.
the request method after a 302 redirect. Setting bit 2 (value
\fBCURL_REDIR_POST_303) makes libcurl maintain the request method after a 302
redirect. CURL_REDIR_POST_ALL is a convenience define that sets both bits.
The non-RFC behaviour is ubiquitous in web browsers, so the library does the
conversion by default to maintain consistency. However, a server may require a

View File

@@ -649,6 +649,7 @@ CURL_READFUNC_PAUSE 7.18.0
CURL_REDIR_GET_ALL 7.19.1
CURL_REDIR_POST_301 7.19.1
CURL_REDIR_POST_302 7.19.1
CURL_REDIR_POST_303 7.25.1
CURL_REDIR_POST_ALL 7.19.1
CURL_RTSPREQ_ANNOUNCE 7.20.0
CURL_RTSPREQ_DESCRIBE 7.20.0