diff options
author | Daniel Stenberg <daniel@haxx.se> | 2008-09-05 16:13:20 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2008-09-05 16:13:20 +0000 |
commit | 18110b519c56a464bca4258332279c580f07a52f (patch) | |
tree | 0818c63153e939254958ebeacce23ac713bd9bba /include | |
parent | 4c9768565ec3a9baf26ac8a547bca6e42cc64fa5 (diff) |
- Martin Drasar provided the CURLOPT_POSTREDIR patch. It renames
CURLOPT_POST301 (but adds a define for backwards compatibility for you who
don't define CURL_NO_OLDIES). This option allows you to now also change the
libcurl behavior for a HTTP response 302 after a POST to not use GET in the
subsequent request (when CURLOPT_FOLLOWLOCATION is enabled). I edited the
patch somewhat before commit. The curl tool got a matching --post302
option. Test case 1076 was added to verify this.
Diffstat (limited to 'include')
-rw-r--r-- | include/curl/curl.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/include/curl/curl.h b/include/curl/curl.h index 2b574c9d7..d93fd6764 100644 --- a/include/curl/curl.h +++ b/include/curl/curl.h @@ -1103,8 +1103,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), + /* Set the behaviour of POST when redirecting. Values must be set to one + of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */ + CINIT(POSTREDIR, LONG, 161), /* used by scp/sftp to verify the host's public key */ CINIT(SSH_HOST_PUBLIC_KEY_MD5, OBJECTPOINT, 162), @@ -1147,6 +1148,11 @@ typedef enum { the obsolete stuff removed! */ /* Backwards compatibility with older names */ +/* These are scheduled to disappear by 2011 */ + +/* This was added in version 7.19.1 */ +#define CURLOPT_POST301 CURLOPT_POSTREDIR + /* These are scheduled to disappear by 2009 */ /* The following were added in 7.17.0 */ @@ -1211,6 +1217,14 @@ enum { CURL_SSLVERSION_LAST /* never use, keep last */ }; +/* symbols to use with CURLOPT_POSTREDIR. + CURL_REDIR_POST_301 and CURL_REDIR_POST_302 can be bitwise ORed so that + CURL_REDIR_POST_301 | CURL_REDIR_POST_302 == CURL_REDIR_POST_ALL */ + +#define CURL_REDIR_GET_ALL 0 +#define CURL_REDIR_POST_301 1 +#define CURL_REDIR_POST_302 2 +#define CURL_REDIR_POST_ALL (CURL_REDIR_POST_301|CURL_REDIR_POST_302) typedef enum { CURL_TIMECOND_NONE, |