opts: added examples
This commit is contained in:
@@ -47,9 +47,23 @@ when setting \fICURLOPT_FOLLOWLOCATION(3)\fP.
|
||||
.SH DEFAULT
|
||||
0
|
||||
.SH PROTOCOLS
|
||||
HTTP
|
||||
HTTP(S)
|
||||
.SH EXAMPLE
|
||||
TODO
|
||||
.nf
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
|
||||
/* a silly POST example */
|
||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "data=true");
|
||||
|
||||
/* example.com is redirected, so we tell libcurl to send POST on 301, 302 and
|
||||
303 HTTP response codes */
|
||||
curl_easy_setopt(curl, CURLOPT_POSTREDIR, CURL_REDIR_POST_ALL);
|
||||
|
||||
curl_easy_perform(curl);
|
||||
}
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
Added in 7.17.1. This option was known as CURLOPT_POST301 up to 7.19.0 as it
|
||||
only supported the 301 then. CURL_REDIR_POST_303 was added in 7.26.0.
|
||||
|
||||
Reference in New Issue
Block a user