summaryrefslogtreecommitdiff
path: root/docs/libcurl/curl_easy_setopt.3
blob: ec25606c847adb17d6794ff055360c7b667dff8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
.SH HTTP OPTIONS
.IP CURLOPT_AUTOREFERER
Automatically set Referer: header. See \fICURLOPT_AUTOREFERER(3)\fP
.IP CURLOPT_ACCEPT_ENCODING
Accept-Encoding and automatic decompressing data. See \fICURLOPT_ACCEPT_ENCODING(3)\fP
.IP CURLOPT_TRANSFER_ENCODING
Request Transfer-Encoding. See \fICURLOPT_TRANSFER_ENCODING(3)\fP
.IP CURLOPT_FOLLOWLOCATION
Follow HTTP redirects. See \fICURLOPT_FOLLOWLOCATION(3)\fP
.IP CURLOPT_UNRESTRICTED_AUTH
Do not restrict authentication to original host. \fICURLOPT_UNRESTRICTED_AUTH(3)\fP
.IP CURLOPT_MAXREDIRS
Maximum number of redirects to follow. See \fICURLOPT_MAXREDIRS(3)\fP
.IP CURLOPT_POSTREDIR
How to act on redirects after POST. See \fICURLOPT_POSTREDIR(3)\fP
.IP CURLOPT_PUT
Issue a HTTP PUT request. See \fICURLOPT_PUT(3)\fP
.IP CURLOPT_POST
Issue a HTTP POST request. See \fICURLOPT_POST(3)\fP
.IP CURLOPT_POSTFIELDS
Send a POST with this data. See \fICURLOPT_POSTFIELDS(3)\fP
.IP CURLOPT_POSTFIELDSIZE
The POST data is this big. See \fICURLOPT_POSTFIELDSIZE(3)\fP
.IP CURLOPT_POSTFIELDSIZE_LARGE
The POST data is this big. See \fICURLOPT_POSTFIELDSIZE_LARGE(3)\fP
.IP CURLOPT_COPYPOSTFIELDS
Send a POST with this data - and copy it. See \fICURLOPT_COPYPOSTFIELDS(3)\fP
.IP CURLOPT_HTTPPOST
Multipart formpost HTTP POST. See \fICURLOPT_HTTPPOST(3)\fP
.IP CURLOPT_REFERER
Referer: header. See \fICURLOPT_REFERER(3)\fP
.IP CURLOPT_USERAGENT
User-Agent: header. See \fICURLOPT_USERAGENT(3)\fP
.IP CURLOPT_HTTPHEADER
Custom HTTP headers. See \fICURLOPT_HTTPHEADER(3)\fP
.IP CURLOPT_HEADEROPT
Control custom headers. See \fICURLOPT_HEADEROPT(3)\fP
.IP CURLOPT_PROXYHEADER
Custom HTTP headers sent to proxy. See \fICURLOPT_PROXYHEADER(3)\fP
.IP CURLOPT_HTTP200ALIASES
Alternative versions of 200 OK. See \fICURLOPT_HTTP200ALIASES(3)\fP
.IP CURLOPT_COOKIE
Cookie(s) to send. See \fICURLOPT_COOKIE(3)\fP
.IP CURLOPT_COOKIEFILE
File to read cookies from. See \fICURLOPT_COOKIEFILE(3)\fP
.IP CURLOPT_COOKIEJAR
File to write cookies to. See \fICURLOPT_COOKIEJAR(3)\fP
.IP CURLOPT_COOKIESESSION
Start a new cookie session. See \fICURLOPT_COOKIESESSION(3)\fP
.IP CURLOPT_COOKIELIST
Add or control cookies. See \fICURLOPT_COOKIELIST(3)\fP
.IP CURLOPT_HTTPGET
Do a HTTP GET request. See \fICURLOPT_HTTPGET(3)\fP
.IP CURLOPT_HTTP_VERSION
HTTP version to use. \fICURLOPT_HTTP_VERSION(3)\fP
.IP CURLOPT_IGNORE_CONTENT_LENGTH
Ignore Content-Length. See \fICURLOPT_IGNORE_CONTENT_LENGTH(3)\fP
.IP CURLOPT_HTTP_CONTENT_DECODING
Disable Content decoding. See \fICURLOPT_HTTP_CONTENT_DECODING(3)\fP
.IP CURLOPT_HTTP_TRANSFER_DECODING
Disable Transfer decoding. See \fICURLOPT_HTTP_TRANSFER_DECODING(3)\fP
.IP CURLOPT_EXPECT_100_TIMEOUT_MS
100-continue timeout. See \fICURLOPT_EXPECT_100_TIMEOUT_MS(3)\fP
.IP CURLOPT_PIPEWAIT
Wait on connection to pipeline on it. See \fICURLOPT_PIPEWAIT(3)\fP
.SH SMTP OPTIONS
.IP CURLOPT_MAIL_FROM
Address of the sender. See \fICURLOPT_MAIL_FROM(3)\fP
.IP CURLOPT_MAIL_RCPT
Address of the recipients. See \fICURLOPT_MAIL_RCPT(3)\fP
.IP CURLOPT_MAIL_AUTH
Authentication address. See \fICURLOPT_MAIL_AUTH(3)\fP
.SH TFTP OPTIONS
.IP CURLOPT_TFTP_BLKSIZE
TFTP block size. See \fICURLOPT_TFTP_BLKSIZE(3)\fP
.SH FTP OPTIONS
.IP CURLOPT_FTPPORT
Use active FTP. See \fICURLOPT_FTPPORT(3)\fP
.IP CURLOPT_QUOTE
Commands to run before transfer. See \fICURLOPT_QUOTE(3)\fP
.IP CURLOPT_POSTQUOTE
Commands to run after transfer. See \fICURLOPT_POSTQUOTE(3)\fP
.IP CURLOPT_PREQUOTE
Commands to run just before transfer. See \fICURLOPT_PREQUOTE(3)\fP
.IP CURLOPT_APPEND
Append to remote file. See \fICURLOPT_APPEND(3)\fP
.IP CURLOPT_FTP_USE_EPRT
Use EPTR. See \fICURLOPT_FTP_USE_EPRT(3)\fP
.IP CURLOPT_FTP_USE_EPSV
Use EPSV. See \fICURLOPT_FTP_USE_EPSV(3)\fP
.IP CURLOPT_FTP_USE_PRET
Use PRET. See \fICURLOPT_FTP_USE_PRET(3)\fP
.IP CURLOPT_FTP_CREATE_MISSING_DIRS
Create missing directories on the remote server. See \fICURLOPT_FTP_CREATE_MISSING_DIRS(3)\fP
.IP CURLOPT_FTP_RESPONSE_TIMEOUT
Timeout for FTP responses. See \fICURLOPT_FTP_RESPONSE_TIMEOUT(3)\fP
.IP CURLOPT_FTP_ALTERNATIVE_TO_USER
Alternative to USER. See \fICURLOPT_FTP_ALTERNATIVE_TO_USER(3)\fP
.IP CURLOPT_FTP_SKIP_PASV_IP
Ignore the IP address in the PASV response. See \fICURLOPT_FTP_SKIP_PASV_IP(3)\fP
.IP CURLOPT_FTPSSLAUTH
Control how to do TLS. See \fICURLOPT_FTPSSLAUTH(3)\fP
.IP CURLOPT_FTP_SSL_CCC
Back to non-TLS again after authentication. See \fICURLOPT_FTP_SSL_CCC(3)\fP
.IP CURLOPT_FTP_ACCOUNT
Send ACCT command. See \fICURLOPT_FTP_ACCOUNT(3)\fP
.IP CURLOPT_FTP_FILEMETHOD
Specify how to reach files. See \fICURLOPT_FTP_FILEMETHOD(3)\fP
.SH RTSP OPTIONS
.IP CURLOPT_RTSP_REQUEST
RTSP request. See \fICURLOPT_RTSP_REQUEST(3)\fP
.IP CURLOPT_RTSP_SESSION_ID
RTSP session-id. See \fICURLOPT_RTSP_SESSION_ID(3)\fP
.IP CURLOPT_RTSP_STREAM_URI
RTSP stream URI. See \fICURLOPT_RTSP_STREAM_URI(3)\fP
.IP CURLOPT_RTSP_TRANSPORT
RTSP Transport: header. See \fICURLOPT_RTSP_TRANSPORT(3)\fP
.IP CURLOPT_RTSP_CLIENT_CSEQ
Client CSEQ number. See \fICURLOPT_RTSP_CLIENT_CSEQ(3)\fP
.IP CURLOPT_RTSP_SERVER_CSEQ
CSEQ number for RTSP Server->Client request. See \fICURLOPT_RTSP_SERVER_CSEQ(3)\fP
.SH PROTOCOL OPTIONS
.IP CURLOPT_TRANSFERTEXT
Use text transfer. See \fICURLOPT_TRANSFERTEXT(3)\fP
.IP CURLOPT_PROXY_TRANSFER_MODE
Add transfer mode to URL over proxy. See \fICURLOPT_PROXY_TRANSFER_MODE(3)\fP
.IP CURLOPT_CRLF
Convert newlines. See \fICURLOPT_CRLF(3)\fP
.IP CURLOPT_RANGE
Range requests. See \fICURLOPT_RANGE(3)\fP
.IP CURLOPT_RESUME_FROM
Resume a transfer. See \fICURLOPT_RESUME_FROM(3)\fP
.IP CURLOPT_RESUME_FROM_LARGE
Resume a transfer. See \fICURLOPT_RESUME_FROM_LARGE(3)\fP
.IP CURLOPT_CUSTOMREQUEST
Custom request/method. See \fICURLOPT_CUSTOMREQUEST(3)\fP
.IP CURLOPT_FILETIME
Request file modification date and time. See \fICURLOPT_FILETIME(3)\fP
.IP CURLOPT_DIRLISTONLY
List only. See \fICURLOPT_DIRLISTONLY(3)\fP
.IP CURLOPT_NOBODY
Do not get the body contents. See \fICURLOPT_NOBODY(3)\fP
.IP CURLOPT_INFILESIZE
Size of file to send. \fICURLOPT_INFILESIZE(3)\fP
.IP CURLOPT_INFILESIZE_LARGE
Size of file to send. \fICURLOPT_INFILESIZE_LARGE(3)\fP
.IP CURLOPT_UPLOAD
Upload data. See \fICURLOPT_UPLOAD(3)\fP
.IP CURLOPT_MAXFILESIZE
Maximum file size to get. See \fICURLOPT_MAXFILESIZE(3)\fP
.IP CURLOPT_MAXFILESIZE_LARGE
Maximum file size to get. See \fICURLOPT_MAXFILESIZE_LARGE(3)\fP
.IP CURLOPT_TIMECONDITION
Make a time conditional request. See \fICURLOPT_TIMECONDITION(3)\fP
.IP CURLOPT_TIMEVALUE
Time value for the time conditional request. See \fICURLOPT_TIMEVALUE(3)\fP
.SH CONNECTION OPTIONS
.IP CURLOPT_TIMEOUT
Timeout for the entire request. See \fICURLOPT_TIMEOUT(3)\fP
.IP CURLOPT_TIMEOUT_MS
Millisecond timeout for the entire request. See \fICURLOPT_TIMEOUT_MS(3)\fP
.IP CURLOPT_LOW_SPEED_LIMIT
Low speed limit to abort transfer. See \fICURLOPT_LOW_SPEED_LIMIT(3)\fP
.IP CURLOPT_LOW_SPEED_TIME
Time to be below the speed to trigger low speed abort. See \fICURLOPT_LOW_SPEED_TIME(3)\fP
.IP CURLOPT_MAX_SEND_SPEED_LARGE
Cap the upload speed to this. See \fICURLOPT_MAX_SEND_SPEED_LARGE(3)\fP
.IP CURLOPT_MAX_RECV_SPEED_LARGE
Cap the download speed to this. See \fICURLOPT_MAX_RECV_SPEED_LARGE(3)\fP
.IP CURLOPT_MAXCONNECTS
Maximum number of connections in the connection pool. See \fICURLOPT_MAXCONNECTS(3)\fP
.IP CURLOPT_FRESH_CONNECT
Use a new connection. \fICURLOPT_FRESH_CONNECT(3)\fP
.IP CURLOPT_FORBID_REUSE
Prevent subsequent connections from re-using this. See \fICURLOPT_FORBID_REUSE(3)\fP
.IP CURLOPT_CONNECTTIMEOUT
Timeout for the connection phase. See \fICURLOPT_CONNECTTIMEOUT(3)\fP
.IP CURLOPT_CONNECTTIMEOUT_MS
Millisecond timeout for the connection phase. See \fICURLOPT_CONNECTTIMEOUT_MS(3)\fP
.IP CURLOPT_IPRESOLVE
IP version to resolve to. See \fICURLOPT_IPRESOLVE(3)\fP
.IP CURLOPT_CONNECT_ONLY
Only connect, nothing else. See \fICURLOPT_CONNECT_ONLY(3)\fP
.IP CURLOPT_USE_SSL
Use TLS/SSL. See \fICURLOPT_USE_SSL(3)\fP
.IP CURLOPT_RESOLVE
Provide fixed/fake name resolves. See \fICURLOPT_RESOLVE(3)\fP
.IP CURLOPT_DNS_INTERFACE
Bind name resolves to this interface. See \fICURLOPT_DNS_INTERFACE(3)\fP
.IP CURLOPT_DNS_LOCAL_IP4
Bind name resolves to this IP4 address. See \fICURLOPT_DNS_LOCAL_IP4(3)\fP
.IP CURLOPT_DNS_LOCAL_IP6
Bind name resolves to this IP6 address. See \fICURLOPT_DNS_LOCAL_IP6(3)\fP
.IP CURLOPT_DNS_SERVERS
Preferred DNS servers. See \fICURLOPT_DNS_SERVERS(3)\fP
.IP CURLOPT_ACCEPTTIMEOUT_MS
Timeout for waiting for the server's connect back to be accepted. See \fICURLOPT_ACCEPTTIMEOUT_MS(3)\fP
.SH SSL and SECURITY OPTIONS
.IP CURLOPT_SSLCERT
Client cert. See \fICURLOPT_SSLCERT(3)\fP
.IP CURLOPT_SSLCERTTYPE
Client cert type.  See \fICURLOPT_SSLCERTTYPE(3)\fP
.IP CURLOPT_SSLKEY
Client key. See \fICURLOPT_SSLKEY(3)\fP
.IP CURLOPT_SSLKEYTYPE
Client key type. See \fICURLOPT_SSLKEYTYPE(3)\fP
.IP CURLOPT_KEYPASSWD
Client key password. See \fICURLOPT_KEYPASSWD(3)\fP
.IP CURLOPT_SSL_ENABLE_ALPN
Enable use of ALPN. See \fICURLOPT_SSL_ENABLE_ALPN(3)\fP
.IP CURLOPT_SSL_ENABLE_NPN
Enable use of NPN. See \fICURLOPT_SSL_ENABLE_NPN(3)\fP
.IP CURLOPT_SSLENGINE
Use identifier with SSL engine. See \fICURLOPT_SSLENGINE(3)\fP
.IP CURLOPT_SSLENGINE_DEFAULT
Default SSL engine. See \fICURLOPT_SSLENGINE_DEFAULT(3)\fP
.IP CURLOPT_SSL_FALSESTART
Enable TLS False Start. See \fICURLOPT_SSL_FALSESTART(3)\fP
.IP CURLOPT_SSLVERSION
SSL version to use. See \fICURLOPT_SSLVERSION(3)\fP
.IP CURLOPT_SSL_VERIFYHOST
Verify the host name in the SSL certificate. See \fICURLOPT_SSL_VERIFYHOST(3)\fP
.IP CURLOPT_SSL_VERIFYPEER
Verify the SSL certificate. See \fICURLOPT_SSL_VERIFYPEER(3)\fP
.IP CURLOPT_SSL_VERIFYSTATUS
Verify the SSL certificate's status. See \fICURLOPT_SSL_VERIFYSTATUS(3)\fP
.IP CURLOPT_CAINFO
CA cert bundle. See \fICURLOPT_CAINFO(3)\fP
.IP CURLOPT_ISSUERCERT
Issuer certificate. See \fICURLOPT_ISSUERCERT(3)\fP
.IP CURLOPT_CAPATH
Path to CA cert bundle. See \fICURLOPT_CAPATH(3)\fP
.IP CURLOPT_CRLFILE
Certificate Revocation List. See \fICURLOPT_CRLFILE(3)\fP
.IP CURLOPT_CERTINFO
Extract certificate info. See \fICURLOPT_CERTINFO(3)\fP
.IP CURLOPT_PINNEDPUBLICKEY
Set pinned SSL public key . See \fICURLOPT_PINNEDPUBLICKEY(3)\fP
.IP CURLOPT_RANDOM_FILE
Provide source for entropy random data. See \fICURLOPT_RANDOM_FILE(3)\fP
.IP CURLOPT_EGDSOCKET
Identify EGD socket for entropy. See \fICURLOPT_EGDSOCKET(3)\fP
.IP CURLOPT_SSL_CIPHER_LIST
Ciphers to use. See \fICURLOPT_SSL_CIPHER_LIST(3)\fP
.IP CURLOPT_SSL_SESSIONID_CACHE
Disable SSL session-id cache. See \fICURLOPT_SSL_SESSIONID_CACHE(3)\fP
.IP CURLOPT_SSL_OPTIONS
Control SSL behavior. See \fICURLOPT_SSL_OPTIONS(3)\fP
.IP CURLOPT_KRBLEVEL
Kerberos security level. See \fICURLOPT_KRBLEVEL(3)\fP
.IP CURLOPT_GSSAPI_DELEGATION
Disable GSS-API delegation. See \fICURLOPT_GSSAPI_DELEGATION(3)\fP
.SH SSH OPTIONS
.IP CURLOPT_SSH_AUTH_TYPES
SSH authentication types. See \fICURLOPT_SSH_AUTH_TYPES(3)\fP
.IP CURLOPT_SSH_HOST_PUBLIC_KEY_MD5
MD5 of host's public key. See \fICURLOPT_SSH_HOST_PUBLIC_KEY_MD5(3)\fP
.IP CURLOPT_SSH_PUBLIC_KEYFILE
File name of public key. See \fICURLOPT_SSH_PUBLIC_KEYFILE(3)\fP
.IP CURLOPT_SSH_PRIVATE_KEYFILE
File name of private key. See \fICURLOPT_SSH_PRIVATE_KEYFILE(3)\fP
.IP CURLOPT_SSH_KNOWNHOSTS
File name with known hosts. See \fICURLOPT_SSH_KNOWNHOSTS(3)\fP
.IP CURLOPT_SSH_KEYFUNCTION
Callback for known hosts handling. See \fICURLOPT_SSH_KEYFUNCTION(3)\fP
.IP CURLOPT_SSH_KEYDATA
Custom pointer to pass to ssh key callback. See \fICURLOPT_SSH_KEYDATA(3)\fP
.SH OTHER OPTIONS
.IP CURLOPT_PRIVATE
Private pointer to store. See \fICURLOPT_PRIVATE(3)\fP
.IP CURLOPT_SHARE
Share object to use. See \fICURLOPT_SHARE(3)\fP
.IP CURLOPT_NEW_FILE_PERMS
Mode for creating new remote files. See \fICURLOPT_NEW_FILE_PERMS(3)\fP
.IP CURLOPT_NEW_DIRECTORY_PERMS
Mode for creating new remote directories. See \fICURLOPT_NEW_DIRECTORY_PERMS(3)\fP
.SH TELNET OPTIONS
.IP CURLOPT_TELNETOPTIONS
TELNET options. See \fICURLOPT_TELNETOPTIONS(3)\fP
.SH RETURN VALUE
\fICURLE_OK\fP (zero) means that the option was set properly, non-zero means an
error occurred as \fI<curl/curl.h>\fP defines. See the \fIlibcurl-errors(3)\fP
man page for the full list with descriptions.

If you try to set an option that libcurl doesn't know about, perhaps because
the library is too old to support it or the option was removed in a recent
version, this function will return \fICURLE_UNKNOWN_OPTION\fP. If support for
the option was disabled at compile-time, it will return
\fICURLE_NOT_BUILT_IN\fP.
.SH EXAMPLE
.nf
CURL *curl = curl_easy_init();
if(curl) {
  CURLcode res;
  curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
  res = curl_easy_perform(curl);
  curl_easy_cleanup(curl);
}}
.fi
.SH "SEE ALSO"
.BR curl_easy_init "(3), " curl_easy_cleanup "(3), " curl_easy_reset "(3), "
.BR curl_multi_setopt "(3), "