58f8e28086bb6fc5c3cf0a1f7746c555108597a3
[platform/upstream/curl.git] / docs / libcurl / opts / CURLOPT_REDIR_PROTOCOLS.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2  "http://www.w3.org/TR/html4/loose.dtd">
3 <html><head>
4 <title>CURLOPT_REDIR_PROTOCOLS man page</title>
5 <meta name="generator" content="roffit">
6 <STYLE type="text/css">
7 P.level0 {
8  padding-left: 2em;
9 }
10
11 P.level1 {
12  padding-left: 4em;
13 }
14
15 P.level2 {
16  padding-left: 6em;
17 }
18
19 span.emphasis {
20  font-style: italic;
21 }
22
23 span.bold {
24  font-weight: bold;
25 }
26
27 span.manpage {
28  font-weight: bold;
29 }
30
31 h2.nroffsh {
32  background-color: #e0e0e0;
33 }
34
35 span.nroffip {
36  font-weight: bold;
37  font-size: 120%;
38  font-family: monospace;
39 }
40
41 p.roffit {
42  text-align: center;
43  font-size: 80%;
44 }
45 </STYLE>
46 </head><body>
47
48 <p class="level0"><a name="NAME"></a><h2 class="nroffsh">NAME</h2>
49 <p class="level0">CURLOPT_REDIR_PROTOCOLS - set protocols allowed to redirect to <a name="SYNOPSIS"></a><h2 class="nroffsh">SYNOPSIS</h2>
50 <p class="level0">#include &lt;curl/curl.h&gt; 
51 <p class="level0">CURLcode curl_easy_setopt(CURL *handle, CURLOPT_REDIR_PROTOCOLS, long bitmask); <a name="DESCRIPTION"></a><h2 class="nroffsh">DESCRIPTION</h2>
52 <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. 
53 <p class="level0">These are the available protocol defines: <pre>
54 <p class="level0">CURLPROTO_DICT
55  CURLPROTO_FILE
56  CURLPROTO_FTP
57  CURLPROTO_FTPS
58  CURLPROTO_GOPHER
59  CURLPROTO_HTTP
60  CURLPROTO_HTTPS
61  CURLPROTO_IMAP
62  CURLPROTO_IMAPS
63  CURLPROTO_LDAP
64  CURLPROTO_LDAPS
65  CURLPROTO_POP3
66  CURLPROTO_POP3S
67  CURLPROTO_RTMP
68  CURLPROTO_RTMPE
69  CURLPROTO_RTMPS
70  CURLPROTO_RTMPT
71  CURLPROTO_RTMPTE
72  CURLPROTO_RTMPTS
73  CURLPROTO_RTSP
74  CURLPROTO_SCP
75  CURLPROTO_SFTP
76  CURLPROTO_SMB
77  CURLPROTO_SMTP
78  CURLPROTO_SMTPS
79  CURLPROTO_TELNET
80  CURLPROTO_TFTP
81  </pre>
82
83 <p class="level0"><a name="DEFAULT"></a><h2 class="nroffsh">DEFAULT</h2>
84 <p class="level0">All protocols except for FILE, SCP and SMB. <a name="PROTOCOLS"></a><h2 class="nroffsh">PROTOCOLS</h2>
85 <p class="level0">All <a name="EXAMPLE"></a><h2 class="nroffsh">EXAMPLE</h2>
86 <p class="level0"><pre>
87 <p class="level0">curl = curl_easy_init();
88  if(curl) {
89  &nbsp; /* pass in the URL from an external source */
90  &nbsp; curl_easy_setopt(curl, CURLOPT_URL, argv[1]);
91  <p class="level0">&nbsp; /* only allow redirects to HTTP and HTTPS URLs */
92  &nbsp; curl_easy_setopt(curl, CURLOPT_REDIR_PROTOCOLS,
93  &nbsp;                  CURLPROTO_HTTP | CURLPROTO_HTTPS);
94  <p class="level0">&nbsp; /* Perform the request */
95  &nbsp; curl_easy_perform(curl);
96  }
97  </pre>
98
99 <p class="level0"><a name="AVAILABILITY"></a><h2 class="nroffsh">AVAILABILITY</h2>
100 <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>
101 <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>
102 <p class="level0"><a Class="manpage" href="./CURLOPT_PROTOCOLS.html">CURLOPT_PROTOCOLS</a>, <span Class="manpage"> </span> <p class="roffit">
103  This HTML page was made with <a href="http://daniel.haxx.se/projects/roffit/">roffit</a>.
104 </body></html>