mirror of
https://github.com/curl/curl.git
synced 2026-08-15 10:14:06 +03:00
examples: make use of CURLOPT_(REDIR_|)PROTOCOLS_STR
To show how to use them Closes #11334
This commit is contained in:
parent
b39181cedc
commit
741b6853b9
2 changed files with 5 additions and 0 deletions
|
|
@ -95,6 +95,8 @@ CURL *make_handle(char *url)
|
|||
curl_easy_setopt(handle, CURLOPT_ACCEPT_ENCODING, "");
|
||||
curl_easy_setopt(handle, CURLOPT_TIMEOUT, 5L);
|
||||
curl_easy_setopt(handle, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
/* only allow redirects to HTTP and HTTPS URLs */
|
||||
curl_easy_setopt(handle, CURLOPT_REDIR_PROTOCOLS_STR, "http,https");
|
||||
curl_easy_setopt(handle, CURLOPT_AUTOREFERER, 1L);
|
||||
curl_easy_setopt(handle, CURLOPT_MAXREDIRS, 10L);
|
||||
curl_easy_setopt(handle, CURLOPT_CONNECTTIMEOUT, 2L);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue