From fd4cf78f36e89b8a0913e4fb34fd7a89f5c0cfd4 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 26 Sep 2007 12:44:59 +0000 Subject: Philip Langdale provided the new CURLOPT_POST301 option for curl_easy_setopt() that alters how libcurl functions when following redirects. It makes libcurl obey the RFC2616 when a 301 response is received after a non-GET request is made. Default libcurl behaviour is to change method to GET in the subsequent request (like it does for response code 302 - because that's what many/most browsers do), but with this CURLOPT_POST301 option enabled it will do what the spec says and do the next request using the same method again. I.e keep POST after 301. The curl tool got this option as --post301 Test case 1011 and 1012 were added to verify. --- include/curl/curl.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/curl/curl.h b/include/curl/curl.h index e7f5ec59c..0df943344 100644 --- a/include/curl/curl.h +++ b/include/curl/curl.h @@ -1124,6 +1124,9 @@ typedef enum { CINIT(NEW_FILE_PERMS, LONG, 159), CINIT(NEW_DIRECTORY_PERMS, LONG, 160), + /* Obey RFC 2616/10.3.2 and keep POSTs as POSTs after a 301 */ + CINIT(POST301, LONG, 161), + CURLOPT_LASTENTRY /* the last unused */ } CURLoption; -- cgit v1.2.3