Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.3
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
10.6
Statistic
FMM
Blog
CURL.SetOptionPostRedir
Sets the redirect policy.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| CURL | 2.5 | Yes | Yes | Yes | Yes | Yes |
MBS( "CURL.SetOptionPostRedir"; curl; Value ) More
Parameters
| Parameter | Description | Example |
|---|---|---|
| curl | The CURL session handle. | $curl |
| Value | The new bitmask for redirections. | 3 |
Result
Returns "OK" on success.
Description
Sets the redirect policy.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 CURL_REDIR_POST_301) 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 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 POST to remain a POST after such a redirection. This option is meaningful only when setting CURL.SetOptionFollowLocation. (This option was known as CURLOPT_POST301 up to 7.19.0 as it only supported the 301 way before then)
| CURL_REDIR_POST_301 | 1 |
| CURL_REDIR_POST_302 | 2 |
| CURL_REDIR_POST_ALL | 3 |
See also POSTREDIR option in CURL manual.
See also
- CURL.GetOptionPostFields
- CURL.GetOptionPostQuote
- CURL.SetOptionCookieJar
- CURL.SetOptionFollowLocation
- CURL.SetOptionMaxRedirs
- CURL.SetOptionPost
- CURL.SetOptionPostFields
- CURL.SetOptionPostFieldSize
- CURL.SetOptionPostQuote
- CURL.SetOptionProxyHeader
Created 18th August 2014, last changed 18th August 2014
CURL.SetOptionPostQuote - CURL.SetOptionPreProxy
Feedback: Report problem or ask question.
Links
MBS Xojo tutorial videos