Revert "Update to 7.40.1"
[platform/upstream/curl.git] / docs / libcurl / opts / CURLOPT_POSTREDIR.3
1 .\" **************************************************************************
2 .\" *                                  _   _ ____  _
3 .\" *  Project                     ___| | | |  _ \| |
4 .\" *                             / __| | | | |_) | |
5 .\" *                            | (__| |_| |  _ <| |___
6 .\" *                             \___|\___/|_| \_\_____|
7 .\" *
8 .\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
9 .\" *
10 .\" * This software is licensed as described in the file COPYING, which
11 .\" * you should have received as part of this distribution. The terms
12 .\" * are also available at http://curl.haxx.se/docs/copyright.html.
13 .\" *
14 .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 .\" * copies of the Software, and permit persons to whom the Software is
16 .\" * furnished to do so, under the terms of the COPYING file.
17 .\" *
18 .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 .\" * KIND, either express or implied.
20 .\" *
21 .\" **************************************************************************
22 .\"
23 .TH CURLOPT_POSTREDIR 3 "19 Jun 2014" "libcurl 7.37.0" "curl_easy_setopt options"
24 .SH NAME
25 CURLOPT_POSTREDIR \- how to act on a HTTP POST redirect
26 .SH SYNOPSIS
27 .nf
28 #include <curl/curl.h>
29
30 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_POSTREDIR,
31                           long bitmask);
32 .SH DESCRIPTION
33 Pass a bitmask to control how libcurl acts on redirects after POSTs that get a
34 301, 302 or 303 response back.  A parameter with bit 0 set (value
35 \fBCURL_REDIR_POST_301\fP) tells the library to respect RFC2616/10.3.2 and not
36 convert POST requests into GET requests when following a 301 redirection.
37 Setting bit 1 (value \fBCURL_REDIR_POST_302\fP) makes libcurl maintain the
38 request method after a 302 redirect whilst setting bit 2 (value
39 \fBCURL_REDIR_POST_303\fP) makes libcurl maintain the request method after a
40 303 redirect. The value \fBCURL_REDIR_POST_ALL\fP is a convenience define that
41 sets all three bits.
42
43 The non-RFC behaviour is ubiquitous in web browsers, so the library does the
44 conversion by default to maintain consistency. However, a server may require a
45 POST to remain a POST after such a redirection. This option is meaningful only
46 when setting \fICURLOPT_FOLLOWLOCATION(3)\fP.
47 .SH DEFAULT
48 0
49 .SH PROTOCOLS
50 HTTP
51 .SH EXAMPLE
52 TODO
53 .SH AVAILABILITY
54 Added in 7.17.1. This option was known as CURLOPT_POST301 up to 7.19.0 as it
55 only supported the 301 then.
56 .SH RETURN VALUE
57 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
58 .SH "SEE ALSO"
59 .BR CURLOPT_FOLLOWLOCATION "(3), " CURLOPT_POSTFIELDS "(3), "