1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
4 <title>CURLOPT_REDIR_PROTOCOLS man page</title>
5 <meta name="generator" content="roffit">
6 <STYLE type="text/css">
12 P.level0, pre.level0 {
16 P.level1, pre.level1 {
20 P.level2, pre.level2 {
37 background-color: #e0e0e0;
43 font-family: monospace;
53 <p class="level0"><a name="NAME"></a><h2 class="nroffsh">NAME</h2>
54 <p class="level0">CURLOPT_REDIR_PROTOCOLS - set protocols allowed to redirect to <a name="SYNOPSIS"></a><h2 class="nroffsh">SYNOPSIS</h2>
55 <p class="level0">#include <curl/curl.h>
56 <p class="level0">CURLcode curl_easy_setopt(CURL *handle, CURLOPT_REDIR_PROTOCOLS, long bitmask); <a name="DESCRIPTION"></a><h2 class="nroffsh">DESCRIPTION</h2>
57 <p class="level0">Pass a long that holds a bitmask of CURLPROTO_* defines. If used, this bitmask limits what protocols libcurl may use in a transfer that it follows to in a redirect when <a Class="emphasis" href="./CURLOPT_FOLLOWLOCATION.html">CURLOPT_FOLLOWLOCATION</a> is enabled. This allows you to limit specific transfers to only be allowed to use a subset of protocols in redirections. By default libcurl will allow all protocols except for FILE and SCP.
58 <p class="level0">These are the available protocol defines: <pre class="level0">
88 <p class="level0"><a name="DEFAULT"></a><h2 class="nroffsh">DEFAULT</h2>
89 <p class="level0">All protocols except for FILE, SCP and SMB. <a name="PROTOCOLS"></a><h2 class="nroffsh">PROTOCOLS</h2>
90 <p class="level0">All <a name="EXAMPLE"></a><h2 class="nroffsh">EXAMPLE</h2>
91 <p class="level0"><pre class="level0">
92 curl = curl_easy_init();
94 /* pass in the URL from an external source */
95 curl_easy_setopt(curl, CURLOPT_URL, argv[1]);
97 /* only allow redirects to HTTP and HTTPS URLs */
98 curl_easy_setopt(curl, CURLOPT_REDIR_PROTOCOLS,
99 CURLPROTO_HTTP | CURLPROTO_HTTPS);
101 /* Perform the request */
102 curl_easy_perform(curl);
106 <p class="level0"><a name="AVAILABILITY"></a><h2 class="nroffsh">AVAILABILITY</h2>
107 <p class="level0">Added in 7.19.4, before then it would follow all protocols. <a name="RETURN"></a><h2 class="nroffsh">RETURN VALUE</h2>
108 <p class="level0">Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. <a name="SEE"></a><h2 class="nroffsh">SEE ALSO</h2>
109 <p class="level0"><a Class="manpage" href="./CURLOPT_PROTOCOLS.html">CURLOPT_PROTOCOLS</a>, <span Class="manpage"> </span> <p class="roffit">
110 This HTML page was made with <a href="http://daniel.haxx.se/projects/roffit/">roffit</a>.