1curl_easy_setopt(3)             libcurl Manual             curl_easy_setopt(3)
2
3
4

NAME

6       curl_easy_setopt - set options for a curl easy handle
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLoption option, parameter);
12

DESCRIPTION

14       curl_easy_setopt(3)  is  used to tell libcurl how to behave. By setting
15       the appropriate options, the application can change libcurl's behavior.
16       All options are set with an option followed by a parameter. That param‐
17       eter can be a  long,  a  function  pointer,  an  object  pointer  or  a
18       curl_off_t,  depending  on  what the specific option expects. Read this
19       manual carefully as bad input values may cause libcurl to behave badly!
20       You  can  only set one option in each function call. A typical applica‐
21       tion uses many curl_easy_setopt(3) calls in the setup phase.
22
23       Options set with this function  call  are  valid  for  all  forthcoming
24       transfers  performed  using this handle. The options are not in any way
25       reset between transfers, so if you want subsequent transfers with  dif‐
26       ferent options, you must change them between the transfers. You can op‐
27       tionally reset all options back to internal default with  curl_easy_re‐
28       set(3).
29
30       Strings  passed to libcurl as 'char *' arguments, are copied by the li‐
31       brary; the string storage associated to the  pointer  argument  may  be
32       discarded  or reused after curl_easy_setopt(3) returns. The only excep‐
33       tion to this rule is really CURLOPT_POSTFIELDS(3), but the  alternative
34       that copies the string CURLOPT_COPYPOSTFIELDS(3) has some usage charac‐
35       teristics you need to read up on. This function does not  accept  input
36       strings longer than CURL_MAX_INPUT_LENGTH (8 MB).
37
38       The order in which the options are set does not matter.
39
40       Before  version  7.17.0,  strings were not copied. Instead the user was
41       forced keep them available until libcurl no longer needed them.
42
43       The  handle  is  the  return   code   from   a   curl_easy_init(3)   or
44       curl_easy_duphandle(3) call.
45

BEHAVIOR OPTIONS

47       CURLOPT_VERBOSE
48              Display verbose information. See CURLOPT_VERBOSE(3)
49
50       CURLOPT_HEADER
51              Include the header in the body output. See CURLOPT_HEADER(3)
52
53       CURLOPT_NOPROGRESS
54              Shut off the progress meter. See CURLOPT_NOPROGRESS(3)
55
56       CURLOPT_NOSIGNAL
57              Do not install signal handlers. See CURLOPT_NOSIGNAL(3)
58
59       CURLOPT_WILDCARDMATCH
60              Transfer  multiple  files  according to a file name pattern. See
61              CURLOPT_WILDCARDMATCH(3)
62

CALLBACK OPTIONS

64       CURLOPT_WRITEFUNCTION
65              Callback for writing data. See CURLOPT_WRITEFUNCTION(3)
66
67       CURLOPT_WRITEDATA
68              Data pointer to pass to the write callback.  See  CURLOPT_WRITE‐
69              DATA(3)
70
71       CURLOPT_READFUNCTION
72              Callback for reading data. See CURLOPT_READFUNCTION(3)
73
74       CURLOPT_READDATA
75              Data  pointer  to  pass  to the read callback. See CURLOPT_READ‐
76              DATA(3)
77
78       CURLOPT_IOCTLFUNCTION
79              Callback for I/O operations. See CURLOPT_IOCTLFUNCTION(3)
80
81       CURLOPT_IOCTLDATA
82              Data pointer to pass to the  I/O  callback.  See  CURLOPT_IOCTL‐
83              DATA(3)
84
85       CURLOPT_SEEKFUNCTION
86              Callback for seek operations. See CURLOPT_SEEKFUNCTION(3)
87
88       CURLOPT_SEEKDATA
89              Data  pointer  to  pass  to the seek callback. See CURLOPT_SEEK‐
90              DATA(3)
91
92       CURLOPT_SOCKOPTFUNCTION
93              Callback for sockopt operations. See CURLOPT_SOCKOPTFUNCTION(3)
94
95       CURLOPT_SOCKOPTDATA
96              Data pointer to pass to the sockopt callback. See  CURLOPT_SOCK‐
97              OPTDATA(3)
98
99       CURLOPT_OPENSOCKETFUNCTION
100              Callback for socket creation. See CURLOPT_OPENSOCKETFUNCTION(3)
101
102       CURLOPT_OPENSOCKETDATA
103              Data  pointer  to  pass  to  the  open socket callback. See CUR‐
104              LOPT_OPENSOCKETDATA(3)
105
106       CURLOPT_CLOSESOCKETFUNCTION
107              Callback for closing socket. See CURLOPT_CLOSESOCKETFUNCTION(3)
108
109       CURLOPT_CLOSESOCKETDATA
110              Data pointer to pass to the  close  socket  callback.  See  CUR‐
111              LOPT_CLOSESOCKETDATA(3)
112
113       CURLOPT_PROGRESSFUNCTION
114              OBSOLETE  callback for progress meter. See CURLOPT_PROGRESSFUNC‐
115              TION(3)
116
117       CURLOPT_PROGRESSDATA
118              Data pointer to pass to the progress meter  callback.  See  CUR‐
119              LOPT_PROGRESSDATA(3)
120
121       CURLOPT_XFERINFOFUNCTION
122              Callback for progress meter. See CURLOPT_XFERINFOFUNCTION(3)
123
124       CURLOPT_XFERINFODATA
125              Data  pointer  to  pass to the progress meter callback. See CUR‐
126              LOPT_XFERINFODATA(3)
127
128       CURLOPT_HEADERFUNCTION
129              Callback for writing received headers.  See  CURLOPT_HEADERFUNC‐
130              TION(3)
131
132       CURLOPT_HEADERDATA
133              Data pointer to pass to the header callback. See CURLOPT_HEADER‐
134              DATA(3)
135
136       CURLOPT_DEBUGFUNCTION
137              Callback for debug information. See CURLOPT_DEBUGFUNCTION(3)
138
139       CURLOPT_DEBUGDATA
140              Data pointer to pass to the debug callback.  See  CURLOPT_DEBUG‐
141              DATA(3)
142
143       CURLOPT_SSL_CTX_FUNCTION
144              Callback for SSL context logic. See CURLOPT_SSL_CTX_FUNCTION(3)
145
146       CURLOPT_SSL_CTX_DATA
147              Data  pointer  to  pass  to  the  SSL context callback. See CUR‐
148              LOPT_SSL_CTX_DATA(3)
149
150       CURLOPT_CONV_TO_NETWORK_FUNCTION
151              Callback for  code  base  conversion.  See  CURLOPT_CONV_TO_NET‐
152              WORK_FUNCTION(3)
153
154       CURLOPT_CONV_FROM_NETWORK_FUNCTION
155              Callback  for  code  base conversion. See CURLOPT_CONV_FROM_NET‐
156              WORK_FUNCTION(3)
157
158       CURLOPT_CONV_FROM_UTF8_FUNCTION
159              Callback    for    code    base     conversion.     See     CUR‐
160              LOPT_CONV_FROM_UTF8_FUNCTION(3)
161
162       CURLOPT_INTERLEAVEFUNCTION
163              Callback  for RTSP interleaved data. See CURLOPT_INTERLEAVEFUNC‐
164              TION(3)
165
166       CURLOPT_INTERLEAVEDATA
167              Data pointer to pass to the RTSP interleave callback.  See  CUR‐
168              LOPT_INTERLEAVEDATA(3)
169
170       CURLOPT_CHUNK_BGN_FUNCTION
171              Callback   for  wildcard  download  start  of  chunk.  See  CUR‐
172              LOPT_CHUNK_BGN_FUNCTION(3)
173
174       CURLOPT_CHUNK_END_FUNCTION
175              Callback  for  wildcard  download  end  of   chunk.   See   CUR‐
176              LOPT_CHUNK_END_FUNCTION(3)
177
178       CURLOPT_CHUNK_DATA
179              Data   pointer   to  pass  to  the  chunk  callbacks.  See  CUR‐
180              LOPT_CHUNK_DATA(3)
181
182       CURLOPT_FNMATCH_FUNCTION
183              Callback for wildcard matching. See CURLOPT_FNMATCH_FUNCTION(3)
184
185       CURLOPT_FNMATCH_DATA
186              Data pointer to pass to the wildcard matching callback. See CUR‐
187              LOPT_FNMATCH_DATA(3)
188
189       CURLOPT_SUPPRESS_CONNECT_HEADERS
190              Suppress proxy CONNECT response headers from user callbacks. See
191              CURLOPT_SUPPRESS_CONNECT_HEADERS(3)
192
193       CURLOPT_RESOLVER_START_FUNCTION
194              Callback to be called before a new resolve request  is  started.
195              See CURLOPT_RESOLVER_START_FUNCTION(3)
196
197       CURLOPT_RESOLVER_START_DATA
198              Data pointer to pass to resolver start callback. See CURLOPT_RE‐
199              SOLVER_START_DATA(3)
200
201       CURLOPT_PREREQFUNCTION
202              Callback to be called after a connection is established but  be‐
203              fore  a  request is made on that connection. See CURLOPT_PREREQ‐
204              FUNCTION(3)
205
206       CURLOPT_PREREQDATA
207              Data pointer to pass to the CURLOPT_PREREQFUNCTION callback. See
208              CURLOPT_PREREQDATA(3)
209

ERROR OPTIONS

211       CURLOPT_ERRORBUFFER
212              Error message buffer. See CURLOPT_ERRORBUFFER(3)
213
214       CURLOPT_STDERR
215              stderr replacement stream. See CURLOPT_STDERR(3)
216
217       CURLOPT_FAILONERROR
218              Fail on HTTP 4xx errors. CURLOPT_FAILONERROR(3)
219
220       CURLOPT_KEEP_SENDING_ON_ERROR
221              Keep  sending on HTTP >= 300 errors. CURLOPT_KEEP_SENDING_ON_ER‐
222              ROR(3)
223

NETWORK OPTIONS

225       CURLOPT_URL
226              URL to work on. See CURLOPT_URL(3)
227
228       CURLOPT_PATH_AS_IS
229              Disable squashing /../ and /./ sequences in the path.  See  CUR‐
230              LOPT_PATH_AS_IS(3)
231
232       CURLOPT_PROTOCOLS
233              Allowed protocols. See CURLOPT_PROTOCOLS(3)
234
235       CURLOPT_REDIR_PROTOCOLS
236              Protocols to allow redirects to. See CURLOPT_REDIR_PROTOCOLS(3)
237
238       CURLOPT_DEFAULT_PROTOCOL
239              Default protocol. See CURLOPT_DEFAULT_PROTOCOL(3)
240
241       CURLOPT_PROXY
242              Proxy to use. See CURLOPT_PROXY(3)
243
244       CURLOPT_PRE_PROXY
245              Socks proxy to use. See CURLOPT_PRE_PROXY(3)
246
247       CURLOPT_PROXYPORT
248              Proxy port to use. See CURLOPT_PROXYPORT(3)
249
250       CURLOPT_PROXYTYPE
251              Proxy type. See CURLOPT_PROXYTYPE(3)
252
253       CURLOPT_NOPROXY
254              Filter out hosts from proxy use. CURLOPT_NOPROXY(3)
255
256       CURLOPT_HTTPPROXYTUNNEL
257              Tunnel through the HTTP proxy. CURLOPT_HTTPPROXYTUNNEL(3)
258
259       CURLOPT_CONNECT_TO
260              Connect to a specific host and port. See CURLOPT_CONNECT_TO(3)
261
262       CURLOPT_SOCKS5_AUTH
263              Socks5 authentication methods. See CURLOPT_SOCKS5_AUTH(3)
264
265       CURLOPT_SOCKS5_GSSAPI_SERVICE
266              Socks5 GSSAPI service name. CURLOPT_SOCKS5_GSSAPI_SERVICE(3)
267
268       CURLOPT_SOCKS5_GSSAPI_NEC
269              Socks5 GSSAPI NEC mode. See CURLOPT_SOCKS5_GSSAPI_NEC(3)
270
271       CURLOPT_PROXY_SERVICE_NAME
272              Proxy authentication service name. CURLOPT_PROXY_SERVICE_NAME(3)
273
274       CURLOPT_HAPROXYPROTOCOL
275              Send  an  HAProxy  PROXY protocol v1 header. See CURLOPT_HAPROX‐
276              YPROTOCOL(3)
277
278       CURLOPT_SERVICE_NAME
279              Authentication service name. CURLOPT_SERVICE_NAME(3)
280
281       CURLOPT_INTERFACE
282              Bind connection locally to this. See CURLOPT_INTERFACE(3)
283
284       CURLOPT_LOCALPORT
285              Bind connection locally to this port. See CURLOPT_LOCALPORT(3)
286
287       CURLOPT_LOCALPORTRANGE
288              Bind connection locally to  port  range.  See  CURLOPT_LOCALPOR‐
289              TRANGE(3)
290
291       CURLOPT_DNS_CACHE_TIMEOUT
292              Timeout for DNS cache. See CURLOPT_DNS_CACHE_TIMEOUT(3)
293
294       CURLOPT_DNS_USE_GLOBAL_CACHE
295              OBSOLETE     Enable     global     DNS     cache.    See    CUR‐
296              LOPT_DNS_USE_GLOBAL_CACHE(3)
297
298       CURLOPT_DOH_URL
299              Use this DoH server for name resolves. See CURLOPT_DOH_URL(3)
300
301       CURLOPT_BUFFERSIZE
302              Ask for alternate buffer size. See CURLOPT_BUFFERSIZE(3)
303
304       CURLOPT_PORT
305              Port number to connect to. See CURLOPT_PORT(3)
306
307       CURLOPT_TCP_FASTOPEN
308              Enable TFO, TCP Fast Open. See CURLOPT_TCP_FASTOPEN(3)
309
310       CURLOPT_TCP_NODELAY
311              Disable the Nagle algorithm. See CURLOPT_TCP_NODELAY(3)
312
313       CURLOPT_ADDRESS_SCOPE
314              IPv6 scope for local addresses. See CURLOPT_ADDRESS_SCOPE(3)
315
316       CURLOPT_TCP_KEEPALIVE
317              Enable TCP keep-alive. See CURLOPT_TCP_KEEPALIVE(3)
318
319       CURLOPT_TCP_KEEPIDLE
320              Idle time before sending keep-alive. See CURLOPT_TCP_KEEPIDLE(3)
321
322       CURLOPT_TCP_KEEPINTVL
323              Interval between keep-alive probes. See CURLOPT_TCP_KEEPINTVL(3)
324
325       CURLOPT_UNIX_SOCKET_PATH
326              Path to a Unix domain socket. See CURLOPT_UNIX_SOCKET_PATH(3)
327
328       CURLOPT_ABSTRACT_UNIX_SOCKET
329              Path  to  an  abstract  Unix  domain  socket.  See   CURLOPT_AB‐
330              STRACT_UNIX_SOCKET(3)
331

NAMES and PASSWORDS OPTIONS (Authentication)

333       CURLOPT_NETRC
334              Enable .netrc parsing. See CURLOPT_NETRC(3)
335
336       CURLOPT_NETRC_FILE
337              .netrc file name. See CURLOPT_NETRC_FILE(3)
338
339       CURLOPT_USERPWD
340              User name and password. See CURLOPT_USERPWD(3)
341
342       CURLOPT_PROXYUSERPWD
343              Proxy user name and password. See CURLOPT_PROXYUSERPWD(3)
344
345       CURLOPT_USERNAME
346              User name. See CURLOPT_USERNAME(3)
347
348       CURLOPT_PASSWORD
349              Password. See CURLOPT_PASSWORD(3)
350
351       CURLOPT_LOGIN_OPTIONS
352              Login options. See CURLOPT_LOGIN_OPTIONS(3)
353
354       CURLOPT_PROXYUSERNAME
355              Proxy user name. See CURLOPT_PROXYUSERNAME(3)
356
357       CURLOPT_PROXYPASSWORD
358              Proxy password. See CURLOPT_PROXYPASSWORD(3)
359
360       CURLOPT_HTTPAUTH
361              HTTP server authentication methods. See CURLOPT_HTTPAUTH(3)
362
363       CURLOPT_TLSAUTH_USERNAME
364              TLS authentication user name. See CURLOPT_TLSAUTH_USERNAME(3)
365
366       CURLOPT_PROXY_TLSAUTH_USERNAME
367              Proxy   TLS  authentication  user  name.  See  CURLOPT_PROXY_TL‐
368              SAUTH_USERNAME(3)
369
370       CURLOPT_TLSAUTH_PASSWORD
371              TLS authentication password. See CURLOPT_TLSAUTH_PASSWORD(3)
372
373       CURLOPT_PROXY_TLSAUTH_PASSWORD
374              Proxy  TLS  authentication   password.   See   CURLOPT_PROXY_TL‐
375              SAUTH_PASSWORD(3)
376
377       CURLOPT_TLSAUTH_TYPE
378              TLS authentication methods. See CURLOPT_TLSAUTH_TYPE(3)
379
380       CURLOPT_PROXY_TLSAUTH_TYPE
381              Proxy   TLS   authentication   methods.   See  CURLOPT_PROXY_TL‐
382              SAUTH_TYPE(3)
383
384       CURLOPT_PROXYAUTH
385              HTTP proxy authentication methods. See CURLOPT_PROXYAUTH(3)
386
387       CURLOPT_SASL_AUTHZID
388              SASL authorisation identity  (identity  to  act  as).  See  CUR‐
389              LOPT_SASL_AUTHZID(3)
390
391       CURLOPT_SASL_IR
392              Enable SASL initial response. See CURLOPT_SASL_IR(3)
393
394       CURLOPT_XOAUTH2_BEARER
395              OAuth2 bearer token. See CURLOPT_XOAUTH2_BEARER(3)
396
397       CURLOPT_DISALLOW_USERNAME_IN_URL
398              Do   not  allow  username  in  URL.  See  CURLOPT_DISALLOW_USER‐
399              NAME_IN_URL(3)
400

HTTP OPTIONS

402       CURLOPT_AUTOREFERER
403              Automatically set Referer: header. See CURLOPT_AUTOREFERER(3)
404
405       CURLOPT_ACCEPT_ENCODING
406              Accept-Encoding  and  automatic  decompressing  data.  See  CUR‐
407              LOPT_ACCEPT_ENCODING(3)
408
409       CURLOPT_TRANSFER_ENCODING
410              Request Transfer-Encoding. See CURLOPT_TRANSFER_ENCODING(3)
411
412       CURLOPT_FOLLOWLOCATION
413              Follow HTTP redirects. See CURLOPT_FOLLOWLOCATION(3)
414
415       CURLOPT_UNRESTRICTED_AUTH
416              Do  not  restrict authentication to original host. CURLOPT_UNRE‐
417              STRICTED_AUTH(3)
418
419       CURLOPT_MAXREDIRS
420              Maximum number of redirects to follow. See CURLOPT_MAXREDIRS(3)
421
422       CURLOPT_POSTREDIR
423              How to act on redirects after POST. See CURLOPT_POSTREDIR(3)
424
425       CURLOPT_PUT
426              Issue an HTTP PUT request. See CURLOPT_PUT(3)
427
428       CURLOPT_POST
429              Issue an HTTP POST request. See CURLOPT_POST(3)
430
431       CURLOPT_POSTFIELDS
432              Send a POST with this data. See CURLOPT_POSTFIELDS(3)
433
434       CURLOPT_POSTFIELDSIZE
435              The POST data is this big. See CURLOPT_POSTFIELDSIZE(3)
436
437       CURLOPT_POSTFIELDSIZE_LARGE
438              The POST data is this big. See CURLOPT_POSTFIELDSIZE_LARGE(3)
439
440       CURLOPT_COPYPOSTFIELDS
441              Send a POST with this data - and copy it. See  CURLOPT_COPYPOST‐
442              FIELDS(3)
443
444       CURLOPT_HTTPPOST
445              Multipart formpost HTTP POST. See CURLOPT_HTTPPOST(3)
446
447       CURLOPT_REFERER
448              Referer: header. See CURLOPT_REFERER(3)
449
450       CURLOPT_USERAGENT
451              User-Agent: header. See CURLOPT_USERAGENT(3)
452
453       CURLOPT_HTTPHEADER
454              Custom HTTP headers. See CURLOPT_HTTPHEADER(3)
455
456       CURLOPT_HEADEROPT
457              Control custom headers. See CURLOPT_HEADEROPT(3)
458
459       CURLOPT_PROXYHEADER
460              Custom HTTP headers sent to proxy. See CURLOPT_PROXYHEADER(3)
461
462       CURLOPT_HTTP200ALIASES
463              Alternative versions of 200 OK. See CURLOPT_HTTP200ALIASES(3)
464
465       CURLOPT_COOKIE
466              Cookie(s) to send. See CURLOPT_COOKIE(3)
467
468       CURLOPT_COOKIEFILE
469              File to read cookies from. See CURLOPT_COOKIEFILE(3)
470
471       CURLOPT_COOKIEJAR
472              File to write cookies to. See CURLOPT_COOKIEJAR(3)
473
474       CURLOPT_COOKIESESSION
475              Start a new cookie session. See CURLOPT_COOKIESESSION(3)
476
477       CURLOPT_COOKIELIST
478              Add or control cookies. See CURLOPT_COOKIELIST(3)
479
480       CURLOPT_ALTSVC
481              Specify the Alt-Svc: cache file name. See CURLOPT_ALTSVC(3)
482
483       CURLOPT_ALTSVC_CTRL
484              Enable    and    configure    Alt-Svc:   treatment.   See   CUR‐
485              LOPT_ALTSVC_CTRL(3)
486
487       CURLOPT_HSTS
488              Set HSTS cache file. See CURLOPT_HSTS(3)
489
490       CURLOPT_HSTS_CTRL
491              Enable HSTS. See CURLOPT_HSTS_CTRL(3)
492
493       CURLOPT_HSTSREADFUNCTION
494              Set HSTS read callback. See CURLOPT_HSTSREADFUNCTION(3)
495
496       CURLOPT_HSTSREADDATA
497              Pass pointer to the HSTS read  callback.  See  CURLOPT_HSTSREAD‐
498              DATA(3)
499
500       CURLOPT_HSTSWRITEFUNCTION
501              Set HSTS write callback. See CURLOPT_HSTSWRITEFUNCTION(3)
502
503       CURLOPT_HSTSWRITEDATA
504              Pass  pointer to the HSTS write callback. See CURLOPT_HSTSWRITE‐
505              DATA(3)
506
507       CURLOPT_HTTPGET
508              Do an HTTP GET request. See CURLOPT_HTTPGET(3)
509
510       CURLOPT_REQUEST_TARGET
511              Set the request target. CURLOPT_REQUEST_TARGET(3)
512
513       CURLOPT_HTTP_VERSION
514              HTTP version to use. CURLOPT_HTTP_VERSION(3)
515
516       CURLOPT_HTTP09_ALLOWED
517              Allow HTTP/0.9 responses. CURLOPT_HTTP09_ALLOWED(3)
518
519       CURLOPT_IGNORE_CONTENT_LENGTH
520              Ignore Content-Length. See CURLOPT_IGNORE_CONTENT_LENGTH(3)
521
522       CURLOPT_HTTP_CONTENT_DECODING
523              Disable Content decoding. See CURLOPT_HTTP_CONTENT_DECODING(3)
524
525       CURLOPT_HTTP_TRANSFER_DECODING
526              Disable Transfer decoding. See CURLOPT_HTTP_TRANSFER_DECODING(3)
527
528       CURLOPT_EXPECT_100_TIMEOUT_MS
529              100-continue timeout. See CURLOPT_EXPECT_100_TIMEOUT_MS(3)
530
531       CURLOPT_TRAILERFUNCTION
532              Set callback for sending trailing headers. See  CURLOPT_TRAILER‐
533              FUNCTION(3)
534
535       CURLOPT_TRAILERDATA
536              Custom pointer passed to the trailing headers callback. See CUR‐
537              LOPT_TRAILERDATA(3)
538
539       CURLOPT_PIPEWAIT
540              Wait on connection to pipeline on it. See CURLOPT_PIPEWAIT(3)
541
542       CURLOPT_STREAM_DEPENDS
543              This HTTP/2 stream depends on  another.  See  CURLOPT_STREAM_DE‐
544              PENDS(3)
545
546       CURLOPT_STREAM_DEPENDS_E
547              This  HTTP/2  stream  depends  on  another exclusively. See CUR‐
548              LOPT_STREAM_DEPENDS_E(3)
549
550       CURLOPT_STREAM_WEIGHT
551              Set this HTTP/2 stream's weight. See CURLOPT_STREAM_WEIGHT(3)
552

SMTP OPTIONS

554       CURLOPT_MAIL_FROM
555              Address of the sender. See CURLOPT_MAIL_FROM(3)
556
557       CURLOPT_MAIL_RCPT
558              Address of the recipients. See CURLOPT_MAIL_RCPT(3)
559
560       CURLOPT_MAIL_AUTH
561              Authentication address. See CURLOPT_MAIL_AUTH(3)
562
563       CURLOPT_MAIL_RCPT_ALLLOWFAILS
564              Allow RCPT TO command to fail  for  some  recipients.  See  CUR‐
565              LOPT_MAIL_RCPT_ALLLOWFAILS(3)
566

TFTP OPTIONS

568       CURLOPT_TFTP_BLKSIZE
569              TFTP block size. See CURLOPT_TFTP_BLKSIZE(3)
570
571       CURLOPT_TFTP_NO_OPTIONS
572              Do  not  send  TFTP  options  requests.  See CURLOPT_TFTP_NO_OP‐
573              TIONS(3)
574

FTP OPTIONS

576       CURLOPT_FTPPORT
577              Use active FTP. See CURLOPT_FTPPORT(3)
578
579       CURLOPT_QUOTE
580              Commands to run before transfer. See CURLOPT_QUOTE(3)
581
582       CURLOPT_POSTQUOTE
583              Commands to run after transfer. See CURLOPT_POSTQUOTE(3)
584
585       CURLOPT_PREQUOTE
586              Commands to run just before transfer. See CURLOPT_PREQUOTE(3)
587
588       CURLOPT_APPEND
589              Append to remote file. See CURLOPT_APPEND(3)
590
591       CURLOPT_FTP_USE_EPRT
592              Use EPTR. See CURLOPT_FTP_USE_EPRT(3)
593
594       CURLOPT_FTP_USE_EPSV
595              Use EPSV. See CURLOPT_FTP_USE_EPSV(3)
596
597       CURLOPT_FTP_USE_PRET
598              Use PRET. See CURLOPT_FTP_USE_PRET(3)
599
600       CURLOPT_FTP_CREATE_MISSING_DIRS
601              Create missing  directories  on  the  remote  server.  See  CUR‐
602              LOPT_FTP_CREATE_MISSING_DIRS(3)
603
604       CURLOPT_FTP_RESPONSE_TIMEOUT
605              Timeout for FTP responses. See CURLOPT_FTP_RESPONSE_TIMEOUT(3)
606
607       CURLOPT_FTP_ALTERNATIVE_TO_USER
608              Alternative to USER. See CURLOPT_FTP_ALTERNATIVE_TO_USER(3)
609
610       CURLOPT_FTP_SKIP_PASV_IP
611              Ignore   the   IP   address  in  the  PASV  response.  See  CUR‐
612              LOPT_FTP_SKIP_PASV_IP(3)
613
614       CURLOPT_FTPSSLAUTH
615              Control how to do TLS. See CURLOPT_FTPSSLAUTH(3)
616
617       CURLOPT_FTP_SSL_CCC
618              Back  to  non-TLS   again   after   authentication.   See   CUR‐
619              LOPT_FTP_SSL_CCC(3)
620
621       CURLOPT_FTP_ACCOUNT
622              Send ACCT command. See CURLOPT_FTP_ACCOUNT(3)
623
624       CURLOPT_FTP_FILEMETHOD
625              Specify how to reach files. See CURLOPT_FTP_FILEMETHOD(3)
626

RTSP OPTIONS

628       CURLOPT_RTSP_REQUEST
629              RTSP request. See CURLOPT_RTSP_REQUEST(3)
630
631       CURLOPT_RTSP_SESSION_ID
632              RTSP session-id. See CURLOPT_RTSP_SESSION_ID(3)
633
634       CURLOPT_RTSP_STREAM_URI
635              RTSP stream URI. See CURLOPT_RTSP_STREAM_URI(3)
636
637       CURLOPT_RTSP_TRANSPORT
638              RTSP Transport: header. See CURLOPT_RTSP_TRANSPORT(3)
639
640       CURLOPT_RTSP_CLIENT_CSEQ
641              Client CSEQ number. See CURLOPT_RTSP_CLIENT_CSEQ(3)
642
643       CURLOPT_RTSP_SERVER_CSEQ
644              CSEQ   number   for   RTSP   Server->Client  request.  See  CUR‐
645              LOPT_RTSP_SERVER_CSEQ(3)
646
647       CURLOPT_AWS_SIGV4
648              AWS HTTP V4 Signature. See CURLOPT_AWS_SIGV4(3)
649

PROTOCOL OPTIONS

651       CURLOPT_TRANSFERTEXT
652              Use text transfer. See CURLOPT_TRANSFERTEXT(3)
653
654       CURLOPT_PROXY_TRANSFER_MODE
655              Add transfer mode to URL over  proxy.  See  CURLOPT_PROXY_TRANS‐
656              FER_MODE(3)
657
658       CURLOPT_CRLF
659              Convert newlines. See CURLOPT_CRLF(3)
660
661       CURLOPT_RANGE
662              Range requests. See CURLOPT_RANGE(3)
663
664       CURLOPT_RESUME_FROM
665              Resume a transfer. See CURLOPT_RESUME_FROM(3)
666
667       CURLOPT_RESUME_FROM_LARGE
668              Resume a transfer. See CURLOPT_RESUME_FROM_LARGE(3)
669
670       CURLOPT_CURLU
671              Set URL to work on with CURLU *. See CURLOPT_CURLU(3)
672
673       CURLOPT_CUSTOMREQUEST
674              Custom request/method. See CURLOPT_CUSTOMREQUEST(3)
675
676       CURLOPT_FILETIME
677              Request file modification date and time. See CURLOPT_FILETIME(3)
678
679       CURLOPT_DIRLISTONLY
680              List only. See CURLOPT_DIRLISTONLY(3)
681
682       CURLOPT_NOBODY
683              Do not get the body contents. See CURLOPT_NOBODY(3)
684
685       CURLOPT_INFILESIZE
686              Size of file to send. CURLOPT_INFILESIZE(3)
687
688       CURLOPT_INFILESIZE_LARGE
689              Size of file to send. CURLOPT_INFILESIZE_LARGE(3)
690
691       CURLOPT_UPLOAD
692              Upload data. See CURLOPT_UPLOAD(3)
693
694       CURLOPT_UPLOAD_BUFFERSIZE
695              Set upload buffer size. See CURLOPT_UPLOAD_BUFFERSIZE(3)
696
697       CURLOPT_MIMEPOST
698              Post/send MIME data. See CURLOPT_MIMEPOST(3)
699
700       CURLOPT_MIME_OPTIONS
701              Set MIME option flags. See CURLOPT_MIME_OPTIONS(3)
702
703       CURLOPT_MAXFILESIZE
704              Maximum file size to get. See CURLOPT_MAXFILESIZE(3)
705
706       CURLOPT_MAXFILESIZE_LARGE
707              Maximum file size to get. See CURLOPT_MAXFILESIZE_LARGE(3)
708
709       CURLOPT_TIMECONDITION
710              Make a time conditional request. See CURLOPT_TIMECONDITION(3)
711
712       CURLOPT_TIMEVALUE
713              Time   value   for   the  time  conditional  request.  See  CUR‐
714              LOPT_TIMEVALUE(3)
715
716       CURLOPT_TIMEVALUE_LARGE
717              Time  value  for  the  time  conditional   request.   See   CUR‐
718              LOPT_TIMEVALUE_LARGE(3)
719

CONNECTION OPTIONS

721       CURLOPT_TIMEOUT
722              Timeout for the entire request. See CURLOPT_TIMEOUT(3)
723
724       CURLOPT_TIMEOUT_MS
725              Millisecond  timeout  for  the entire request. See CURLOPT_TIME‐
726              OUT_MS(3)
727
728       CURLOPT_LOW_SPEED_LIMIT
729              Low    speed    limit    to    abort    transfer.    See    CUR‐
730              LOPT_LOW_SPEED_LIMIT(3)
731
732       CURLOPT_LOW_SPEED_TIME
733              Time  to be below the speed to trigger low speed abort. See CUR‐
734              LOPT_LOW_SPEED_TIME(3)
735
736       CURLOPT_MAX_SEND_SPEED_LARGE
737              Cap    the    upload     speed     to     this.     See     CUR‐
738              LOPT_MAX_SEND_SPEED_LARGE(3)
739
740       CURLOPT_MAX_RECV_SPEED_LARGE
741              Cap     the     download     speed    to    this.    See    CUR‐
742              LOPT_MAX_RECV_SPEED_LARGE(3)
743
744       CURLOPT_MAXCONNECTS
745              Maximum number of connections in the connection pool.  See  CUR‐
746              LOPT_MAXCONNECTS(3)
747
748       CURLOPT_FRESH_CONNECT
749              Use a new connection. CURLOPT_FRESH_CONNECT(3)
750
751       CURLOPT_FORBID_REUSE
752              Prevent  subsequent  connections  from  re-using  this. See CUR‐
753              LOPT_FORBID_REUSE(3)
754
755       CURLOPT_MAXAGE_CONN
756              Limit the age (idle time) of connections  for  reuse.  See  CUR‐
757              LOPT_MAXAGE_CONN(3)
758
759       CURLOPT_MAXLIFETIME_CONN
760              Limit  the  age  (since  creation) of connections for reuse. See
761              CURLOPT_MAXLIFETIME_CONN(3)
762
763       CURLOPT_CONNECTTIMEOUT
764              Timeout for the connection phase. See CURLOPT_CONNECTTIMEOUT(3)
765
766       CURLOPT_CONNECTTIMEOUT_MS
767              Millisecond timeout for the connection phase.  See  CURLOPT_CON‐
768              NECTTIMEOUT_MS(3)
769
770       CURLOPT_IPRESOLVE
771              IP version to use. See CURLOPT_IPRESOLVE(3)
772
773       CURLOPT_CONNECT_ONLY
774              Only connect, nothing else. See CURLOPT_CONNECT_ONLY(3)
775
776       CURLOPT_USE_SSL
777              Use TLS/SSL. See CURLOPT_USE_SSL(3)
778
779       CURLOPT_RESOLVE
780              Provide fixed/fake name resolves. See CURLOPT_RESOLVE(3)
781
782       CURLOPT_DNS_INTERFACE
783              Bind  name  resolves  to  this interface. See CURLOPT_DNS_INTER‐
784              FACE(3)
785
786       CURLOPT_DNS_LOCAL_IP4
787              Bind name resolves to  this  IP4  address.  See  CURLOPT_DNS_LO‐
788              CAL_IP4(3)
789
790       CURLOPT_DNS_LOCAL_IP6
791              Bind  name  resolves  to  this  IP6 address. See CURLOPT_DNS_LO‐
792              CAL_IP6(3)
793
794       CURLOPT_DNS_SERVERS
795              Preferred DNS servers. See CURLOPT_DNS_SERVERS(3)
796
797       CURLOPT_DNS_SHUFFLE_ADDRESSES
798              Shuffle  addresses  before  use.   See   CURLOPT_DNS_SHUFFLE_AD‐
799              DRESSES(3)
800
801       CURLOPT_ACCEPTTIMEOUT_MS
802              Timeout  for  waiting  for  the  server's connect back to be ac‐
803              cepted. See CURLOPT_ACCEPTTIMEOUT_MS(3)
804
805       CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS
806              Timeout for  happy  eyeballs.  See  CURLOPT_HAPPY_EYEBALLS_TIME‐
807              OUT_MS(3)
808
809       CURLOPT_UPKEEP_INTERVAL_MS
810              Sets  the interval at which connection upkeep are performed. See
811              CURLOPT_UPKEEP_INTERVAL_MS(3)
812

SSL and SECURITY OPTIONS

814       CURLOPT_SSLCERT
815              Client cert. See CURLOPT_SSLCERT(3)
816
817       CURLOPT_SSLCERT_BLOB
818              Client cert memory buffer. See CURLOPT_SSLCERT_BLOB(3)
819
820       CURLOPT_PROXY_SSLCERT
821              Proxy client cert. See CURLOPT_PROXY_SSLCERT(3)
822
823       CURLOPT_PROXY_SSLCERT_BLOB
824              Proxy    client     cert     memory     buffer.     See     CUR‐
825              LOPT_PROXY_SSLCERT_BLOB(3)
826
827       CURLOPT_SSLCERTTYPE
828              Client cert type. See CURLOPT_SSLCERTTYPE(3)
829
830       CURLOPT_PROXY_SSLCERTTYPE
831              Proxy client cert type. See CURLOPT_PROXY_SSLCERTTYPE(3)
832
833       CURLOPT_SSLKEY
834              Client key. See CURLOPT_SSLKEY(3)
835
836       CURLOPT_SSLKEY_BLOB
837              Client key memory buffer. See CURLOPT_SSLKEY_BLOB(3)
838
839       CURLOPT_PROXY_SSLKEY
840              Proxy client key. See CURLOPT_PROXY_SSLKEY(3)
841
842       CURLOPT_PROXY_SSLKEY_BLOB
843              Proxy client key. See CURLOPT_PROXY_SSLKEY_BLOB(3)
844
845       CURLOPT_SSLKEYTYPE
846              Client key type. See CURLOPT_SSLKEYTYPE(3)
847
848       CURLOPT_PROXY_SSLKEYTYPE
849              Proxy client key type. See CURLOPT_PROXY_SSLKEYTYPE(3)
850
851       CURLOPT_KEYPASSWD
852              Client key password. See CURLOPT_KEYPASSWD(3)
853
854       CURLOPT_PROXY_KEYPASSWD
855              Proxy client key password. See CURLOPT_PROXY_KEYPASSWD(3)
856
857       CURLOPT_SSL_EC_CURVES
858              Set key exchange curves. See CURLOPT_SSL_EC_CURVES(3)
859
860       CURLOPT_SSL_ENABLE_ALPN
861              Enable use of ALPN. See CURLOPT_SSL_ENABLE_ALPN(3)
862
863       CURLOPT_SSL_ENABLE_NPN
864              Enable use of NPN. See CURLOPT_SSL_ENABLE_NPN(3)
865
866       CURLOPT_SSLENGINE
867              Use identifier with SSL engine. See CURLOPT_SSLENGINE(3)
868
869       CURLOPT_SSLENGINE_DEFAULT
870              Default SSL engine. See CURLOPT_SSLENGINE_DEFAULT(3)
871
872       CURLOPT_SSL_FALSESTART
873              Enable TLS False Start. See CURLOPT_SSL_FALSESTART(3)
874
875       CURLOPT_SSLVERSION
876              SSL version to use. See CURLOPT_SSLVERSION(3)
877
878       CURLOPT_PROXY_SSLVERSION
879              Proxy SSL version to use. See CURLOPT_PROXY_SSLVERSION(3)
880
881       CURLOPT_SSL_VERIFYHOST
882              Verify   the   host  name  in  the  SSL  certificate.  See  CUR‐
883              LOPT_SSL_VERIFYHOST(3)
884
885       CURLOPT_DOH_SSL_VERIFYHOST
886              Verify the host name in the DoH  (DNS-over-HTTPS)  SSL  certifi‐
887              cate. See CURLOPT_DOH_SSL_VERIFYHOST(3)
888
889       CURLOPT_PROXY_SSL_VERIFYHOST
890              Verify  the  host  name  in  the proxy SSL certificate. See CUR‐
891              LOPT_PROXY_SSL_VERIFYHOST(3)
892
893       CURLOPT_SSL_VERIFYPEER
894              Verify the SSL certificate. See CURLOPT_SSL_VERIFYPEER(3)
895
896       CURLOPT_DOH_SSL_VERIFYPEER
897              Verify  the  DoH  (DNS-over-HTTPS)  SSL  certificate.  See  CUR‐
898              LOPT_DOH_SSL_VERIFYPEER(3)
899
900       CURLOPT_PROXY_SSL_VERIFYPEER
901              Verify  the  proxy  SSL certificate. See CURLOPT_PROXY_SSL_VERI‐
902              FYPEER(3)
903
904       CURLOPT_SSL_VERIFYSTATUS
905              Verify the SSL certificate's status. See  CURLOPT_SSL_VERIFYSTA‐
906              TUS(3)
907
908       CURLOPT_DOH_SSL_VERIFYSTATUS
909              Verify  the  DoH  (DNS-over-HTTPS) SSL certificate's status. See
910              CURLOPT_DOH_SSL_VERIFYSTATUS(3)
911
912       CURLOPT_CAINFO
913              CA cert bundle. See CURLOPT_CAINFO(3)
914
915       CURLOPT_CAINFO_BLOB
916              CA cert bundle memory buffer. See CURLOPT_CAINFO_BLOB(3)
917
918       CURLOPT_PROXY_CAINFO
919              Proxy CA cert bundle. See CURLOPT_PROXY_CAINFO(3)
920
921       CURLOPT_PROXY_CAINFO_BLOB
922              Proxy   CA    cert    bundle    memory    buffer.    See    CUR‐
923              LOPT_PROXY_CAINFO_BLOB(3)
924
925       CURLOPT_ISSUERCERT
926              Issuer certificate. See CURLOPT_ISSUERCERT(3)
927
928       CURLOPT_ISSUERCERT_BLOB
929              Issuer certificate memory buffer. See CURLOPT_ISSUERCERT_BLOB(3)
930
931       CURLOPT_PROXY_ISSUERCERT
932              Proxy issuer certificate. See CURLOPT_PROXY_ISSUERCERT(3)
933
934       CURLOPT_PROXY_ISSUERCERT_BLOB
935              Proxy  issuer  certificate  memory buffer. See CURLOPT_PROXY_IS‐
936              SUERCERT_BLOB(3)
937
938       CURLOPT_CAPATH
939              Path to CA cert bundle. See CURLOPT_CAPATH(3)
940
941       CURLOPT_PROXY_CAPATH
942              Path to proxy CA cert bundle. See CURLOPT_PROXY_CAPATH(3)
943
944       CURLOPT_CRLFILE
945              Certificate Revocation List. See CURLOPT_CRLFILE(3)
946
947       CURLOPT_PROXY_CRLFILE
948              Proxy Certificate Revocation List. See CURLOPT_PROXY_CRLFILE(3)
949
950       CURLOPT_CERTINFO
951              Extract certificate info. See CURLOPT_CERTINFO(3)
952
953       CURLOPT_PINNEDPUBLICKEY
954              Set pinned SSL public key . See CURLOPT_PINNEDPUBLICKEY(3)
955
956       CURLOPT_PROXY_PINNEDPUBLICKEY
957              Set the proxy's pinned SSL public key. See CURLOPT_PROXY_PINNED‐
958              PUBLICKEY(3)
959
960       CURLOPT_RANDOM_FILE
961              Provide   source  for  entropy  random  data.  See  CURLOPT_RAN‐
962              DOM_FILE(3)
963
964       CURLOPT_EGDSOCKET
965              Identify EGD socket for entropy. See CURLOPT_EGDSOCKET(3)
966
967       CURLOPT_SSL_CIPHER_LIST
968              Ciphers to use. See CURLOPT_SSL_CIPHER_LIST(3)
969
970       CURLOPT_PROXY_SSL_CIPHER_LIST
971              Proxy ciphers to use. See CURLOPT_PROXY_SSL_CIPHER_LIST(3)
972
973       CURLOPT_TLS13_CIPHERS
974              TLS 1.3 cipher suites to use. See CURLOPT_TLS13_CIPHERS(3)
975
976       CURLOPT_PROXY_TLS13_CIPHERS
977              Proxy TLS 1.3 cipher suites to use. See  CURLOPT_PROXY_TLS13_CI‐
978              PHERS(3)
979
980       CURLOPT_SSL_SESSIONID_CACHE
981              Disable SSL session-id cache. See CURLOPT_SSL_SESSIONID_CACHE(3)
982
983       CURLOPT_SSL_OPTIONS
984              Control SSL behavior. See CURLOPT_SSL_OPTIONS(3)
985
986       CURLOPT_PROXY_SSL_OPTIONS
987              Control proxy SSL behavior. See CURLOPT_PROXY_SSL_OPTIONS(3)
988
989       CURLOPT_KRBLEVEL
990              Kerberos security level. See CURLOPT_KRBLEVEL(3)
991
992       CURLOPT_GSSAPI_DELEGATION
993              Disable GSS-API delegation. See CURLOPT_GSSAPI_DELEGATION(3)
994

SSH OPTIONS

996       CURLOPT_SSH_AUTH_TYPES
997              SSH authentication types. See CURLOPT_SSH_AUTH_TYPES(3)
998
999       CURLOPT_SSH_COMPRESSION
1000              Enable SSH compression. See CURLOPT_SSH_COMPRESSION(3)
1001
1002       CURLOPT_SSH_HOST_PUBLIC_KEY_MD5
1003              MD5 of host's public key. See CURLOPT_SSH_HOST_PUBLIC_KEY_MD5(3)
1004
1005       CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256
1006              SHA256   of   host's   public   key.  See  CURLOPT_SSH_HOST_PUB‐
1007              LIC_KEY_SHA256(3)
1008
1009       CURLOPT_SSH_PUBLIC_KEYFILE
1010              File name of public key. See CURLOPT_SSH_PUBLIC_KEYFILE(3)
1011
1012       CURLOPT_SSH_PRIVATE_KEYFILE
1013              File name of private key. See CURLOPT_SSH_PRIVATE_KEYFILE(3)
1014
1015       CURLOPT_SSH_KNOWNHOSTS
1016              File name with known hosts. See CURLOPT_SSH_KNOWNHOSTS(3)
1017
1018       CURLOPT_SSH_KEYFUNCTION
1019              Callback for  known  hosts  handling.  See  CURLOPT_SSH_KEYFUNC‐
1020              TION(3)
1021
1022       CURLOPT_SSH_KEYDATA
1023              Custom pointer to pass to ssh key callback. See CURLOPT_SSH_KEY‐
1024              DATA(3)
1025

OTHER OPTIONS

1027       CURLOPT_PRIVATE
1028              Private pointer to store. See CURLOPT_PRIVATE(3)
1029
1030       CURLOPT_SHARE
1031              Share object to use. See CURLOPT_SHARE(3)
1032
1033       CURLOPT_NEW_FILE_PERMS
1034              Mode   for    creating    new    remote    files.    See    CUR‐
1035              LOPT_NEW_FILE_PERMS(3)
1036
1037       CURLOPT_NEW_DIRECTORY_PERMS
1038              Mode for creating new remote directories. See CURLOPT_NEW_DIREC‐
1039              TORY_PERMS(3)
1040

TELNET OPTIONS

1042       CURLOPT_TELNETOPTIONS
1043              TELNET options. See CURLOPT_TELNETOPTIONS(3)
1044

EXAMPLE

1046       CURL *curl = curl_easy_init();
1047       if(curl) {
1048         CURLcode res;
1049         curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
1050         res = curl_easy_perform(curl);
1051         curl_easy_cleanup(curl);
1052       }
1053

AVAILABILITY

1055       Always
1056

RETURN VALUE

1058       CURLE_OK (zero) means that the option was set properly, non-zero  means
1059       an  error  occurred as <curl/curl.h> defines. See the libcurl-errors(3)
1060       man page for the full list with descriptions.
1061
1062       Strings passed on to libcurl must be shorter than 8000000 bytes, other‐
1063       wise  curl_easy_setopt(3) returns CURLE_BAD_FUNCTION_ARGUMENT (added in
1064       7.65.0).
1065
1066       CURLE_BAD_FUNCTION_ARGUMENT is returned when the argument to an  option
1067       is invalid, like perhaps out of range.
1068
1069       If  you  try to set an option that libcurl does not know about, perhaps
1070       because the library is too old to support it or the option was  removed
1071       in a recent version, this function will return CURLE_UNKNOWN_OPTION. If
1072       support for the option was disabled at  compile-time,  it  will  return
1073       CURLE_NOT_BUILT_IN.
1074

SEE ALSO

1076       curl_easy_init(3),       curl_easy_cleanup(3),      curl_easy_reset(3),
1077       curl_easy_getinfo(3),  curl_multi_setopt(3),  curl_easy_option_next(3),
1078       curl_easy_option_by_name(3), curl_easy_option_by_id(3),
1079
1080
1081
1082libcurl 7.82.0                 November 26, 2021           curl_easy_setopt(3)
Impressum