Next | Previous

curl

Properties

  • versionstring:

    The libcurl version.

Functions

get_time(date_string)

Returns the number of seconds since the Epoch, January 1st 1970 00:00:00 in the UTC time zone, for the date and time that the date_string parameter specifies.

PARSING DATES AND TIMES

A "date" is a string containing several items separated by whitespace. The order of the items is immaterial. A date string may contain many flavors of items:

  • Calendar date Can be specified several ways. Month names can only be three-letter english abbreviations, numbers can be zero-prefixed and the year may use 2 or 4 digits.

    Examples: 06 Nov 1994, 06-Nov-94 and Nov-94 6.

  • Time of the day This string specifies the time on a given day. You must specify it with 6 digits with two colons: HH:MM:SS. To not include the time in a date string, will make the function assume 00:00:00.

    Example: 18:19:21.

  • Time zone Specifies international time zone. There are a few acronyms supported, but in general you should instead use the specific relative time compared to UTC. Supported formats include: -1200, MST, +0100.

  • Day of the week items Specifies a day of the week. Days of the week may be spelled out in full (using english): Sunday, Monday, etc or they may be abbreviated to their first three letters. This is usually not info that adds anything.

  • Pure numbers If a decimal number of the form YYYYMMDD appears, then YYYY is read as the year, MM as the month number and DD as the day of the month, for the specified calendar date.

EXAMPLES

Sun, 06 Nov 1994 08:49:37 GMT
Sunday, 06-Nov-94 08:49:37 GMT
Sun Nov  6 08:49:37 1994
06 Nov 1994 08:49:37 GMT
06-Nov-94 08:49:37 GMT
Nov  6 08:49:37 1994
06 Nov 1994 08:49:37
06-Nov-94 08:49:37
1994 Nov 6 08:49:37
GMT 08:49:37 06-Nov-94 Sunday
94 6 Nov 08:49:37
1994 Nov 6
06-Nov-94
Sun Nov 6 94
1994.Nov.6
Sun/Nov/6/94/GMT
Sun, 06 Nov 1994 08:49:37 CET
06 Nov 1994 08:49:37 EST
Sun, 12 Sep 2004 15:05:58 -0700
Sat, 11 Sep 2004 21:32:11 +0200
20040912 15:05:58 -0700
20040911 +0200

STANDARDS

This parser was written to handle date formats specified in RFC 822 (including the update in RFC 1123) using time zone name or time zone delta and RFC 850 (obsoleted by RFC 1036) and ANSI C's asctime() format. These formats are the only ones RFC 7231 says HTTP applications may use.

@static

Parameters
  • string date_string
Returns
  • number

Classes

class Info

cURL request and response informations for get_info()

Fields

  • EFFECTIVE_URLstatic:

    Gets the last used effective URL. If follow redirects is enabled, it may very well not be the same value you set in the original request.

  • RESPONSE_CODEstatic:

    The last received HTTP, FTP or SMTP response code. The value will be zero if no server response code has been received.

  • TOTAL_TIMEstatic:

    The total time in seconds for the previous transfer, including name resolving, TCP connect etc. The value represents the time in seconds, including fractions.

  • NAMELOOKUP_TIMEstatic:

    The total time in seconds from the start until the name resolving was completed.

  • CONNECT_TIMEstatic:

    The total time in seconds from the start until the connection to the remote host (or proxy) was completed.

  • PRETRANSFER_TIMEstatic:

    The time, in seconds, it took from the start until a file transfer is just about to begin.

This time-stamp includes all pre-transfer commands and negotiations that are specific to the particular protocol(s) involved. It includes the sending of the protocol- specific protocol instructions that triggers a transfer.

  • SIZE_UPLOADstatic:

    The total amount of bytes that were uploaded.

  • SIZE_DOWNLOADstatic:

    The total amount of bytes that were downloaded. The amount is only for the latest transfer and will be reset again for each new transfer. This counts actual payload data, what's also commonly called body. All meta and header data are excluded and will not be counted in this number.

  • SPEED_DOWNLOADstatic:

    The average download speed that curl measured for the complete download. Measured in bytes/second.

  • SPEED_UPLOADstatic:

    The average upload speed that curl measured for the complete upload. Measured in bytes/second.

  • HEADER_SIZEstatic:

    The total size of all the headers received. Measured in number of bytes.

  • REQUEST_SIZEstatic:

    The total size of the issued requests. This is so far only for HTTP requests.

  • SSL_VERIFYRESULTstatic:

    The result of the server SSL certificate verification that was requested (using the Options.SSL_VERIFYPEER option).

  • FILETIMEstatic:

    The remote time of the retrieved document (in number of seconds since 1 jan 1970 in the GMT/UTC time zone). If you get -1, it can be because of many reasons (it might be unknown, the server might hide it or the server doesn't support the command that tells document time etc) and the time of the document is unknown.

You MUST to collect this information before the transfer is made, by using the Options.FILETIME option to set_option() or you will unconditionally get a -1 back.

  • CONTENT_LENGTH_DOWNLOADstatic:

    The content-length of the download. This is the value read from the Content-Length: field. It is -1 if the size isn't known.

  • CONTENT_LENGTH_UPLOADstatic:

    The content-length of the upload. It is -1 if the size isn't known.

  • STARTTRANSFER_TIMEstatic:

    The time, in seconds, it took from the start until the first byte is received by curl. This includes PRETRANSFER_TIME and also the time the server needs to calculate the result.

  • CONTENT_TYPEstatic:

    The content-type of the downloaded object. This is the value read from the Content-Type: field. If you get nil, it means that the server didn't send a valid Content-Type header or that the protocol used doesn't support this.

  • REDIRECT_TIMEstatic:

    The total time, in seconds, it took for all redirection steps include name lookup, connect, pretransfer and transfer before final transaction was started.

  • REDIRECT_COUNTstatic:

    The total number of redirections that were actually followed.

  • HTTP_CONNECTCODEstatic:

    The last received HTTP proxy response code to a CONNECT request. The returned value will be zero if no such response code was available.

  • HTTPAUTH_AVAILstatic:

    A bitmask indicating the authentication method(s) available according to the previous response.

  • PROXYAUTH_AVAILstatic:

    A bitmask indicating the authentication method(s) available according to the previous response.

  • OS_ERRNOstatic:

    The errno variable from a connect failure. Note that the value is only set on failure, it is not reset upon a successful operation. The number is OS and system specific.

  • NUM_CONNECTSstatic:

    How many new connections curl had to create to achieve the previous transfer (only the successful connects are counted). Combined with REDIRECT_COUNT you are able to know how many times curl successfully reused existing connection(s) or not.

  • COOKIELISTstatic:

    A list of all cookies curl knows (expired ones, too). If there are no cookies, an empty list is returned.

Cookies that were imported in the Set-Cookie format without a domain name may not exported by this option.

  • FTP_ENTRY_PATHstatic:

    A string holding the path of the entry path. That is the initial path curl ended up in when logging on to the remote FTP server. This value is nil if something is wrong.

  • REDIRECT_URLstatic:

    The URL a redirect would take you to if you would enable FOLLOWLOCATION. This can come very handy if you think using the built-in curl redirect logic isn't good enough for you but you would still prefer to avoid implementing all the magic of figuring out the new URL.

  • PRIMARY_IPstatic:

    A string holding the IP address of the most recent connection done with this curl handle.

  • APPCONNECT_TIMEstatic:

    The time, in seconds, it took from the start until the SSL/SSH connect/handshake to the remote host was completed. This time is most often very near to the PRETRANSFER_TIME time, except for cases such as HTTP pipelining where the pretransfer time can be delayed due to waits in line for the pipeline and more.

  • CERTINFOstatic:

    Lists with info about the certificate chain, assuming you had Options.CERTINFO enabled when the request was made. Information in each entry of the list is provided in a series of data in the format "name:content" where the content is for the specific named data.

  • CONDITION_UNMETstatic:

    The number 1 if the condition provided in the previous request didn't match (see Options.TIMECONDITION). Alas, if this returns a 1 you know that the reason you didn't get data in return is because it didn't fulfill the condition. This value will be zero if the condition was met. This can also return 1 if the server responded with a 304 HTTP status code, for example after sending a custom "If-Match-" header. @static

  • RTSP_SESSION_IDstatic:

    A string holding the most recent RTSP Session ID.

Applications wishing to resume an RTSP session on another connection should retrieve this info before closing the active connection.

  • RTSP_CLIENT_CSEQstatic:

    The next CSeq that will be used by the application.

  • RTSP_SERVER_CSEQstatic:

    The next CSeq that is expected by the application.

Applications wishing to resume an RTSP session on another connection should retrieve this info before closing the active connection.

  • RTSP_CSEQ_RECVstatic:

    The most recently received CSeq from the server.

  • PRIMARY_PORTstatic:

    The destination port of the most recent connection done with the curl instance.

  • LOCAL_IPstatic:

    A string holding the IP address of the local end of most recent connection done with the curl instance.

  • LOCAL_PORTstatic:

    The local port number of the most recent connection done with the curl instance.

  • HTTP_VERSIONstatic:

    The HTTP version used in the last http connection.

  • PROXY_SSL_VERIFYRESULTstatic:

    The result of the certificate verification that was requested (using the Options.PROXY_SSL_VERIFYPEER option.

  • PROTOCOLstatic:

    The protocol used in the last request.

  • SCHEMEstatic:

    A string holding the URL scheme used for the most recent connection done with this curl instance.

  • TOTAL_TIME_Tstatic:

    The total time in microseconds for the previous transfer, including name resolving, TCP connect etc.

  • NAMELOOKUP_TIME_Tstatic:

    The total time in microseconds from the start until the name resolving was completed.

  • CONNECT_TIME_Tstatic:

    The total time in microseconds from the start until the connection to the remote host (or proxy) was completed.

  • PRETRANSFER_TIME_Tstatic:

    The total time in microseconds from the start until the file transfer is just about to begin. This includes all pre-transfer commands and negotiations that are specific to the particular protocol(s) involved. It does not involve the sending of the protocol- specific request that triggers a transfer.

  • STARTTRANSFER_TIME_Tstatic:

    The total time in microseconds from the start until the first byte is received by curl. This includes PRETRANSFER_TIME_T and also the time the server needs to calculate the result.

  • REDIRECT_TIME_Tstatic:

    The total time in microseconds it took for all redirection steps include name lookup, connect, pretransfer and transfer before final transaction was started. It contains the complete execution time for multiple redirections.

  • APPCONNECT_TIME_Tstatic:

    The total time in microseconds from the start until the SSL/SSH connect/handshake to the remote host was completed. This time is most often very near to the PRETRANSFER_TIME_T time, except for cases such as HTTP pipelining where the pretransfer time can be delayed due to waits in line for the pipeline and more.

  • RETRY_AFTERstatic:

    The number of seconds the HTTP server suggests the client should wait until the next request is issued.

While the HTTP header might contain a fixed date string, the RETRY_AFTER will always return number of seconds to wait - or zero if there was no header or the header couldn't be parsed.

class CurlMime

cURL Mime object for multipart-data forms and POST requests.

Methods

CurlMime(curl) ⇢ Constructor

@pram {Curl} curl

add(name, value)

Adds a new mime part with the given name and value.

Parameters
  • string name
  • any value
Returns
  • bool

add_as(value, type)

Adds a new mime part with the given data and type.

Parameters
  • any value
  • string type
Returns
  • bool

add_data(data)

Adds a new mime part with the given data.

Parameters
  • any data
Returns
  • bool

add_file(name, value)

Adds a new mime part with the given name and file.

Parameters
  • string name
  • string|instance value
Returns
  • bool

add_mime(mime, type)

Adds a new mime subpart with the given mime.

Parameters
  • CurlMime mime
  • string type
Returns
  • bool

set_encoding(encoding)

Sets the encoding with which the mime will be transfered.

Parameters
  • string encoding

get_pointer()

Returns the raw pointer object to the underlying libcurl mime implementation.

class CurlList

cURL list interface.

Methods

CurlList(items)

@constrctor

Parameters
  • list[string] items

close()

Close and disposes the pointer to the list

get_pointer()

Returns the raw pointer object to the underlying libcurl list implementation.

class Curl

cURL class

Methods

Curl() ⇢ Constructor

set_option(option, value)

This function is used to tell curl how to behave. By setting the appropriate options, the application can change curl's behavior.
All options are set with an option followed by a parameter. That parameter can be a number, boolean, string, or an object pointer, depending on what the specific option expects. Read this cURL manual carefully as bad input values may cause curl to behave badly! You can only set one option in each function call. A typical application uses many set_option() calls in the setup phase.

Options set with this function call are valid for all forthcoming transfers performed using this instance. The options are not in any way reset between transfers, so if you want subsequent transfers with different options, you must change them between the transfers. You can optionally reset all options back to internal default with reset().

Parameters
  • Option option
  • any value
Returns
  • boolean
Notes
  • Strings passed to curl as arguments, must not exceed 8MB in size.
  • The order in which the options are set does not matter.

get_info(info)

Requests internal information from the curl session with this function. Use this function AFTER performing a transfer if you want to get transfer related data.

Parameters
  • Info info
Returns
  • string|number|list

escape(str)

This function converts the given input string to a URL encoded string and returns that as a new allocated string. All input characters that are not a-z, A-Z, 0-9, '-', '.', '_' or '~' are converted to their "URL escaped" version (%NN where NN is a two-digit hexadecimal number).

Parameters
  • string str
Returns
  • string
Notes
  • This function does not accept a strings longer than 8MB.

unescape(str)

This function converts the given URL encoded input string to a "plain string" and returns that in an allocated memory area. All input characters that are URL encoded (%XX where XX is a two-digit hexadecimal number) are converted to their decoded versions.

Parameters
  • string str
Returns
  • string

send()

Performs the entire request in a blocking manner and returns when done, or if it failed. It returns a dictionary containing the headers and body key.

You must never call this function simultaneously from two places using the same instance. Let the function return first before invoking it another time.

Returns
  • dict

reset()

Re-initializes the instace to the default values. This puts back the instance to the same state as it was in when it was just created.

It keeps live connections, the Session ID cache, the DNS cache, the cookies , the shares or the alt-svc cache.

close()

Closes the current Curl instance.

This might close all connections this instance has used and possibly has kept open until now - unless it was attached to a multi handle while doing the transfers. Don't call this function if you intend to transfer more files, re-using Curl instances is a key to good performance.

Notes
  • Calling a function on the instance after this function has been called is illegal

get_pointer()

Returns the raw pointer object to the underlying libcurl.

class Auth

Auth values for Options.HTTPAUTH and Options.PROXYAUTH

Fields

  • NONEstatic:

    No HTTP authentication

  • BASICstatic:

    HTTP Basic authentication (default)

  • DIGESTstatic:

    HTTP Digest authentication

  • NEGOTIATEstatic:

    HTTP Negotiate (SPNEGO) authentication

  • GSSNEGOTIATEstatic:

    Alias for CURLAUTH_NEGOTIATE (deprecated)

  • NTLMstatic:

    HTTP NTLM authentication

  • DIGEST_IEstatic:

    HTTP Digest authentication with IE flavour

  • NTLM_WBstatic:

    HTTP NTLM authentication delegated to winbind helper

  • BEARERstatic:

    HTTP Bearer token authentication

  • ONLYstatic:

    Use together with a single other type to force no authentication or just that single type.

  • ANYstatic:

    All fine types set

  • ANYSAFEstatic:

    All fine types except Basic

  • SSH_ANYstatic:

    All types of SSH authentication supported by the server

  • SSH_NONEstatic:

    No SSH allowed

  • SSH_PUBLICKEYstatic:

    Public/private key files for SSH authentication.

  • SSH_PASSWORDstatic:

    Password for SSH authentication.

  • SSH_HOSTstatic:

    Host key files for SSH authentication.

  • SSH_KEYBOARDstatic:

    Keyboard interactive SSH authentication.

  • SSH_AGENTstatic:

    Agent (ssh-agent, pageant, etc.) for SSH authentication.

  • SSH_GSSAPIstatic:

    gssapi (kerberos, etc.) for SSH authentication.

  • SSH_DEFAULTstatic:

    The default SSH authentication (same as ANY).

class UseSSL

cURL request options for set_option()

Fields

  • NONEstatic:

    Do not attempt to use SSL.

  • TRYstatic:

    Try using SSL, proceed anyway otherwise.

  • CONTROLstatic:

    Use SSL for the control connection or fail.

  • ALLstatic:

    Use SSL for all communication or fail

class FileType

cURL file types

Fields

  • FILEstatic:

    File

  • DIRECTORYstatic:

    Directory

  • SYMLINKstatic:

    Symbolic Link

  • DEVICE_CHARstatic:

  • NAMEDPIPEstatic:

    Named Pipe

  • SOCKETstatic:

    Socket

  • DOORstatic:

    Door. This is only possible on Sun Solaris now

class Option

cURL request options for set_option()

Fields

  • URLstatic:

    The full URL to get/put

  • PORTstatic:

    Port number to connect to, if other than default.

  • PROXYstatic:

    Name of proxy to use.

  • USERPWDstatic:

    "user:password;options" to use when fetching.

  • PROXYUSERPWDstatic:

    "user:password" to use with proxy.

  • RANGEstatic:

    Range to get, specified as an ASCII string.

  • ERRORBUFFERstatic:

    Buffer to receive error messages in, must be at least CURL_ERROR_SIZE bytes big.

  • TIMEOUTstatic:

    Time-out the read operation after this amount of seconds

  • INFILESIZEstatic:

    If the CURLOPT_INFILE is used, this can be used to inform libcurl about how large the file being sent really is. That allows better error checking and better verifies that the upload was successful. -1 means unknown size. For large file support, there is also a _LARGE version of the key which takes an off_t type, allowing platforms with larger off_t sizes to handle larger files. See below for INFILESIZE_LARGE.

  • POSTFIELDSstatic:

    POST static input fields.

  • REFERERstatic:

    Set the referrer page (needed by some CGIs)

  • FTPPORTstatic:

    Set the FTP PORT string (interface name, named or numerical IP address) Use i.e '-' to use default address.

  • USERAGENTstatic:

    Set the User-Agent string (examined by some CGIs)

  • LOW_SPEED_LIMITstatic:

    Set the "low speed limit"

  • LOW_SPEED_TIMEstatic:

    Set the "low speed time"

  • RESUME_FROMstatic:

    Set the continuation offset. Note there is also a _LARGE version of this key which uses off_t types, allowing for large file offsets on platforms which use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE.

  • COOKIEstatic:

    Set cookie in request:

  • HTTPHEADERstatic:

    This points to a list of HTTP header strings. This list is also used for RTSP (in spite of its name)

  • HTTPPOSTstatic:

    This points to a linked list of post entries.

  • SSLCERTstatic:

    name of the file keeping your private SSL-certificate

  • KEYPASSWDstatic:

    password for the SSL or SSH private key

  • CRLFstatic:

    send TYPE parameter?

  • QUOTEstatic:

    send linked-list of QUOTE commands

  • COOKIEFILEstatic:

    point to a file to read the initial cookies from, also enables "cookie awareness"

  • SSLVERSIONstatic:

    What version to specifically try to use. See CURL_SSLVERSION defines below.

  • TIMECONDITIONstatic:

    What kind of HTTP time condition to use, see defines

  • TIMEVALUEstatic:

    Time to use with the above condition. Specified in number of seconds since 1 Jan 1970

  • CUSTOMREQUESTstatic:

    Custom request, for customizing the get command like HTTP: DELETE, TRACE and others FTP: to use a different list command

  • STDERRstatic:

    FILE handle to use instead of stderr

  • POSTQUOTEstatic:

    send linked-list of post-transfer QUOTE commands

  • VERBOSEstatic:

    talk a lot

  • HEADERstatic:

    throw the header out too

  • NOPROGRESSstatic:

    shut off the progress meter

  • NOBODYstatic:

    use HEAD to get http document

  • FAILONERRORstatic:

    no output on http error codes >= 400

  • UPLOADstatic:

    this is an upload

  • POSTstatic:

    HTTP POST method

  • DIRLISTONLYstatic:

    bare names when listing directories

  • APPENDstatic:

    Append instead of overwrite on upload!

  • NETRCstatic:

    Specify whether to read the user+password from the .netrc or the URL. This must be one of the CURL_NETRC_ enums below. @static

  • FOLLOWLOCATIONstatic:

    use Location: Luke!

  • TRANSFERTEXTstatic:

    transfer data in text/ASCII format

  • PUTstatic:

    HTTP PUT

  • AUTOREFERERstatic:

    We want the referrer field set automatically when following locations

  • PROXYPORTstatic:

    Port of the proxy, can be set in the proxy string as well with: "[host]:[port]"

  • POSTFIELDSIZEstatic:

    size of the POST input data, if strlen() is not good to use

  • HTTPPROXYTUNNELstatic:

    tunnel non-http operations through a HTTP proxy

  • INTERFACEstatic:

    Set the interface string to use as outgoing network interface

  • KRBLEVELstatic:

    Set the krb4/5 security level, this also enables krb4/5 awareness. This is a string, 'clear', 'safe', 'confidential' or 'private'. If the string is set but doesn't match one of these, 'private' will be used.

  • SSL_VERIFYPEERstatic:

    Set if we should verify the peer in ssl handshake, set 1 to verify.

  • CAINFOstatic:

    The CApath or CAfile used to validate the peer certificate this option is used only if SSL_VERIFYPEER is true

  • MAXREDIRSstatic:

    Maximum number of http redirects to follow

  • FILETIMEstatic:

    Pass a long set to 1 to get the date of the requested document (if possible)! Pass a zero to shut it off.

  • TELNETOPTIONSstatic:

    This points to a linked list of telnet options

  • MAXCONNECTSstatic:

    Max amount of cached alive connections

  • FRESH_CONNECTstatic:

    Set to explicitly use a new connection for the upcoming transfer. Do not use this unless you're absolutely sure of this, as it makes the operation slower and is less friendly for the network.

  • FORBID_REUSEstatic:

    Set to explicitly forbid the upcoming transfer's connection to be re-used when done. Do not use this unless you're absolutely sure of this, as it makes the operation slower and is less friendly for the network.

  • CONNECTTIMEOUTstatic:

    Time-out connect operations after this amount of seconds, if connects are OK within this time, then fine... This only aborts the connect phase.

  • HTTPGETstatic:

    Set this to force the HTTP request to get back to GET. Only really usable if POST, PUT or a custom request have been used first.

  • SSL_VERIFYHOSTstatic:

    Set if we should verify the Common name from the peer certificate in ssl handshake, set 1 to check existence, 2 to ensure that it matches the provided hostname.

  • COOKIEJARstatic:

    Specify which file name to write all known cookies in after completed operation. Set file name to "-" (dash) to make it go to stdout.

  • SSL_CIPHER_LISTstatic:

    Specify which SSL ciphers to use

  • HTTP_VERSIONstatic:

    Specify which HTTP version to use! This must be set to one of the CURL_HTTP_VERSION enums set below. @static

  • FTP_USE_EPSVstatic:

    Specifically switch on or off the FTP engine's use of the EPSV command. By default, that one will always be attempted before the more traditional PASV command.

  • SSLCERTTYPEstatic:

    type of the file keeping your SSL-certificate ("DER", "PEM", "ENG")

  • SSLKEYstatic:

    name of the file keeping your private SSL-key

  • SSLKEYTYPEstatic:

    type of the file keeping your private SSL-key ("DER", "PEM", "ENG")

  • SSLENGINEstatic:

    crypto engine for the SSL-sub system

  • SSLENGINE_DEFAULTstatic:

    set the crypto engine for the SSL-sub system as default the param has no meaning...

  • DNS_USE_GLOBAL_CACHEstatic:

    DEPRECATED, do not use!

  • DNS_CACHE_TIMEOUTstatic:

    DNS cache timeout

  • PREQUOTEstatic:

    send linked-list of pre-transfer QUOTE commands

  • COOKIESESSIONstatic:

    mark this as start of a cookie session

  • CAPATHstatic:

    The CApath directory used to validate the peer certificate this option is used only if SSL_VERIFYPEER is true

  • BUFFERSIZEstatic:

    Instruct libcurl to use a smaller receive buffer

  • NOSIGNALstatic:

    Instruct libcurl to not use any signal/alarm handlers, even when using timeouts. This option is useful for multi-threaded applications. See libcurl-the-guide for more background information.

  • SHAREstatic:

    Provide a CURLShare for mutexing non-ts data

  • PROXYTYPEstatic:

    indicates type of proxy. accepted values are CURLPROXY_HTTP (default), CURLPROXY_HTTPS, CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and CURLPROXY_SOCKS5.

  • ACCEPT_ENCODINGstatic:

    Set the Accept-Encoding string. Use this to tell a server you would like the response to be compressed. Before 7.21.6, this was known as CURLOPT_ENCODING

  • PRIVATEstatic:

    Set pointer to private data

  • HTTP200ALIASESstatic:

    Set aliases for HTTP 200 in the HTTP Response header

  • UNRESTRICTED_AUTHstatic:

    Continue to send authentication (user+password) when following locations, even when hostname changed. This can potentially send off the name and password to whatever host the server decides.

  • FTP_USE_EPRTstatic:

    Specifically switch on or off the FTP engine's use of the EPRT command ( it also disables the LPRT attempt). By default, those ones will always be attempted before the good old traditional PORT command.

  • HTTPAUTHstatic:

    Set this to a bitmask value to enable the particular authentications methods you like. Use this in combination with CURLOPT_USERPWD. Note that setting multiple bits may cause extra network round-trips.

  • FTP_CREATE_MISSING_DIRSstatic:

    FTP Option that causes missing dirs to be created on the remote server. In 7.19.4 we introduced the convenience enums for this option using the CURLFTP_CREATE_DIR prefix.

  • PROXYAUTHstatic:

    Set this to a bitmask value to enable the particular authentications methods you like. Use this in combination with CURLOPT_PROXYUSERPWD. Note that setting multiple bits may cause extra network round-trips.

  • FTP_RESPONSE_TIMEOUTstatic:

    FTP option that changes the timeout, in seconds, associated with getting a response. This is different from transfer timeout time and essentially places a demand on the FTP server to acknowledge commands in a timely manner.

  • SERVER_RESPONSE_TIMEOUTstatic:

    This option that changes the timeout, in seconds, associated with getting a response from a server.

  • IPRESOLVEstatic:

    Set this option to one of the CURL_IPRESOLVE_ defines (see below) to tell libcurl to use those IP versions only. This only has effect on systems with support for more than one, i.e IPv4 and IPv6.

  • MAXFILESIZEstatic:

    Set this option to limit the size of a file that will be downloaded from an HTTP or FTP server.

There is also _LARGE version which adds large file support for platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below.

  • INFILESIZE_LARGEstatic:

    See the comment for INFILESIZE above, but in short, specifies the size of the file being uploaded. -1 means unknown.

  • RESUME_FROM_LARGEstatic:

    Sets the continuation offset. There is also a CURLOPTTYPE_LONG version of this; look above for RESUME_FROM.

  • MAXFILESIZE_LARGEstatic:

    Sets the maximum size of data that will be downloaded from an HTTP or FTP server. See MAXFILESIZE above for the LONG version.

  • NETRC_FILEstatic:

    Set this option to the file name of your .netrc file you want libcurl to parse (using the CURLOPT_NETRC option). If not set, libcurl will do a poor attempt to find the user's home directory and check for a .netrc file in there.

  • USE_SSLstatic:

    Enable SSL/TLS for FTP, pick one of: CURLUSESSL_TRY - try using SSL, proceed anyway otherwise CURLUSESSL_CONTROL - SSL for the control connection or fail CURLUSESSL_ALL - SSL for all communication or fail

  • POSTFIELDSIZE_LARGEstatic:

    The _LARGE version of the standard POSTFIELDSIZE option

  • TCP_NODELAYstatic:

    Enable/disable the TCP Nagle algorithm

  • FTPSSLAUTHstatic:

    When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option can be used to change libcurl's default action which is to first try "AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK response has been received.

Available parameters are: CURLFTPAUTH_DEFAULT - let libcurl decide CURLFTPAUTH_SSL - try "AUTH SSL" first, then TLS CURLFTPAUTH_TLS - try "AUTH TLS" first, then SSL

  • FTP_ACCOUNTstatic:

    null-terminated string for pass on to the FTP server when asked for "account" info

  • COOKIELISTstatic:

    feed cookie into cookie engine

  • IGNORE_CONTENT_LENGTHstatic:

    ignore Content-Length

  • FTP_SKIP_PASV_IPstatic:

    Set to non-zero to skip the IP address received in a 227 PASV FTP server response. Typically used for FTP-SSL purposes but is not restricted to that. libcurl will then instead use the same IP address it used for the control connection.

  • FTP_FILEMETHODstatic:

    Select "file method" to use when doing FTP, see the curl ftpmethod above.

  • LOCALPORTstatic:

    Local port number to bind the socket to

  • LOCALPORTRANGEstatic:

    Number of ports to try, including the first one set with LOCALPORT. Thus, setting it to 1 will make no additional attempts but the first.

  • CONNECT_ONLYstatic:

    no transfer, set up connection and let application use the socket by extracting it with CURLINFO_LASTSOCKET

  • MAX_SEND_SPEED_LARGEstatic:

    limit-rate: maximum number of bytes per second to send

  • MAX_RECV_SPEED_LARGEstatic:

    limit-rate: maximum number of bytes per second to receive

  • FTP_ALTERNATIVE_TO_USERstatic:

    Pointer to command string to send if USER/PASS fails.

  • SSL_SESSIONID_CACHEstatic:

    set to 0 to disable session ID re-use for this transfer, default is enabled (== 1)

  • SSH_AUTH_TYPESstatic:

    allowed SSH authentication methods

  • SSH_PUBLIC_KEYFILEstatic:

    Used by scp/sftp to do public key authentication

  • SSH_PRIVATE_KEYFILEstatic:

    Used by scp/sftp to do private key authentication

  • FTP_SSL_CCCstatic:

    Send CCC (Clear Command Channel) after authentication

  • TIMEOUT_MSstatic:

    Same as TIMEOUT, but with ms resolution

  • CONNECTTIMEOUT_MSstatic:

    Same as CONNECTTIMEOUT, but with ms resolution

  • HTTP_TRANSFER_DECODINGstatic:

    set to zero to disable the libcurl's decoding and thus pass the raw body data to the application even when it is encoded/compressed via transfter encoding

  • HTTP_CONTENT_DECODINGstatic:

    set to zero to disable the libcurl's decoding and thus pass the raw body data to the application even when it is encoded/compressed via content encoding

  • NEW_FILE_PERMSstatic:

    Permission used when creating new files on the remote server for protocols that support it, SFTP/SCP/FILE

  • NEW_DIRECTORY_PERMSstatic:

    Permission used when creating new directories on the remote server for protocols that support it, SFTP/SCP/FILE

  • POSTREDIRstatic:

    Set the behavior of POST when redirecting. Values must be set to one of CURL_REDIR defines below. This used to be called CURLOPT_POST301 @static

  • SSH_HOST_PUBLIC_KEY_MD5static:

    used by scp/sftp to verify the host's public key

  • COPYPOSTFIELDSstatic:

    POST volatile input fields.

  • PROXY_TRANSFER_MODEstatic:

    set transfer mode (;type=<a|i>) when doing FTP via an HTTP proxy

  • CRLFILEstatic:

    CRL file

  • ISSUERCERTstatic:

    Issuer certificate

  • ADDRESS_SCOPEstatic:

    (IPv6) Address scope

  • CERTINFOstatic:

    Collect certificate chain info and allow it to get retrievable with CURLINFO_CERTINFO after the transfer is complete.

  • USERNAMEstatic:

    "name" (username) to use when fetching.

  • PASSWORDstatic:

    "pwd" (password) to use when fetching.

  • PROXYUSERNAMEstatic:

    "name" (username) to use with Proxy when fetching.

  • PROXYPASSWORDstatic:

    "pwd" (password) to use with Proxy when fetching.

  • NOPROXYstatic:

    Comma separated list of hostnames defining no-proxy zones. These should match both hostnames directly, and hostnames within a domain. For example, local.com will match local.com and www.local.com, but NOT notlocal.com or www.notlocal.com. For compatibility with other implementations of this, .local.com will be considered to be the same as local.com. A single is the only valid wildcard, and effectively disables the use of proxy.

  • TFTP_BLKSIZEstatic:

    block size for TFTP transfers

  • SOCKS5_GSSAPI_NECstatic:

    Socks Service

  • PROTOCOLSstatic:

    set the bitmask for the protocols that are allowed to be used for the transfer, which thus helps the app which takes URLs from users or other external inputs and want to restrict what protocol(s) to deal with. Defaults to CURLPROTO_ALL.

  • REDIR_PROTOCOLSstatic:

    set the bitmask for the protocols that libcurl is allowed to follow to, as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs to be set in both bitmasks to be allowed to get redirected to.

  • SSH_KNOWNHOSTSstatic:

    set the SSH knownhost file name to use

  • MAIL_FROMstatic:

    set the SMTP mail originator

  • MAIL_RCPTstatic:

    set the list of SMTP mail receiver(s)

  • FTP_USE_PRETstatic:

    FTP: send PRET before PASV

  • RTSP_REQUESTstatic:

    RTSP request method (OPTIONS, SETUP, PLAY, etc...)

  • RTSP_SESSION_IDstatic:

    The RTSP session identifier

  • RTSP_STREAM_URIstatic:

    The RTSP stream URI

  • RTSP_TRANSPORTstatic:

    The Transport: header to use in RTSP requests

  • RTSP_CLIENT_CSEQstatic:

    Manually initialize the client RTSP CSeq for this handle

  • RTSP_SERVER_CSEQstatic:

    Manually initialize the server RTSP CSeq for this handle

  • WILDCARDMATCHstatic:

    Turn on wildcard matching

  • RESOLVEstatic:

    send linked-list of name:port:address sets

  • TLSAUTH_USERNAMEstatic:

    Set a username for authenticated TLS

  • TLSAUTH_PASSWORDstatic:

    Set a password for authenticated TLS

  • TLSAUTH_TYPEstatic:

    Set authentication type for authenticated TLS

  • TRANSFER_ENCODINGstatic:

    Set to 1 to enable the "TE:" header in HTTP requests to ask for compressed transfer-encoded responses. Set to 0 to disable the use of TE: in outgoing requests. The current default is 0, but it might change in a future libcurl release.

libcurl will ask for the compressed methods it knows of, and if that isn't any, it will not ask for transfer-encoding at all even if this option is set to 1.

  • GSSAPI_DELEGATIONstatic:

    allow GSSAPI credential delegation

  • DNS_SERVERSstatic:

    Set the name servers to use for DNS resolution

  • ACCEPTTIMEOUT_MSstatic:

    Time-out accept operations (currently for FTP only) after this amount of milliseconds.

  • TCP_KEEPALIVEstatic:

    Set TCP keepalive

  • TCP_KEEPIDLEstatic:

    non-universal keepalive idle time (Linux, AIX, HP-UX, more)

  • TCP_KEEPINTVLstatic:

    non-universal keepalive interval (Linux, AIX, HP-UX, more)

  • SSL_OPTIONSstatic:

    Enable/disable specific SSL features with a bitmask, see CURLSSLOPT_ @static

  • MAIL_AUTHstatic:

    Set the SMTP auth originator

  • SASL_IRstatic:

    Enable/disable SASL initial response

  • XOAUTH2_BEARERstatic:

    The XOAUTH2 bearer token

  • DNS_INTERFACEstatic:

    Set the interface string to use as outgoing network interface for DNS requests. Only supported by the c-ares DNS backend

  • DNS_LOCAL_IP4static:

    Set the local IPv4 address to use for outgoing DNS requests. Only supported by the c-ares DNS backend

  • DNS_LOCAL_IP6static:

    Set the local IPv6 address to use for outgoing DNS requests. Only supported by the c-ares DNS backend

  • LOGIN_OPTIONSstatic:

    Set authentication options directly

  • SSL_ENABLE_NPNstatic:

    Enable/disable TLS NPN extension (http2 over ssl might fail without)

  • SSL_ENABLE_ALPNstatic:

    Enable/disable TLS ALPN extension (http2 over ssl might fail without)

  • EXPECT_100_TIMEOUT_MSstatic:

    Time to wait for a response to a HTTP request containing an Expect: 100-continue header before sending the data anyway.

  • PROXYHEADERstatic:

    This points to a list of headers used for proxy requests only.

  • HEADEROPTstatic:

    Pass in a bitmask of "header options"

  • PINNEDPUBLICKEYstatic:

    The public key in DER form used to validate the peer public key this option is used only if SSL_VERIFYPEER is true

  • UNIX_SOCKET_PATHstatic:

    Path to Unix domain socket

  • SSL_VERIFYSTATUSstatic:

    Set if we should verify the certificate status.

  • SSL_FALSESTARTstatic:

    Set if we should enable TLS false start.

  • PATH_AS_ISstatic:

    Do not squash dot-dot sequences

  • PROXY_SERVICE_NAMEstatic:

    Proxy Service Name

  • SERVICE_NAMEstatic:

    Service Name

  • PIPEWAITstatic:

    Wait/don't wait for pipe/mutex to clarify

  • DEFAULT_PROTOCOLstatic:

    Set the protocol used when curl is given a URL without a protocol

  • STREAM_WEIGHTstatic:

    Set stream weight, 1 - 256 (default is 16)

  • STREAM_DEPENDSstatic:

    Set stream dependency on another CURL handle

  • STREAM_DEPENDS_Estatic:

    Set E-xclusive stream dependency on another CURL handle

  • TFTP_NO_OPTIONSstatic:

    Do not send any tftp option requests to the server

  • CONNECT_TOstatic:

    Linked-list of host:port:connect-to-host:connect-to-port, overrides the URL's host:port (only for the network layer)

  • TCP_FASTOPENstatic:

    Set TCP Fast Open

  • KEEP_SENDING_ON_ERRORstatic:

    Continue to send data if the server responds early with an HTTP status code >= 300

  • PROXY_CAINFOstatic:

    The CApath or CAfile used to validate the proxy certificate this option is used only if PROXY_SSL_VERIFYPEER is true

  • PROXY_CAPATHstatic:

    The CApath directory used to validate the proxy certificate this option is used only if PROXY_SSL_VERIFYPEER is true

  • PROXY_SSL_VERIFYPEERstatic:

    Set if we should verify the proxy in ssl handshake, set 1 to verify.

  • PROXY_SSL_VERIFYHOSTstatic:

    Set if we should verify the Common name from the proxy certificate in ssl handshake, set 1 to check existence, 2 to ensure that it matches the provided hostname.

  • PROXY_SSLVERSIONstatic:

    What version to specifically try to use for proxy. See CURL_SSLVERSION defines below.

  • PROXY_TLSAUTH_USERNAMEstatic:

    Set a username for authenticated TLS for proxy

  • PROXY_TLSAUTH_PASSWORDstatic:

    Set a password for authenticated TLS for proxy

  • PROXY_TLSAUTH_TYPEstatic:

    Set authentication type for authenticated TLS for proxy

  • PROXY_SSLCERTstatic:

    name of the file keeping your private SSL-certificate for proxy

  • PROXY_SSLCERTTYPEstatic:

    type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") for proxy

  • PROXY_SSLKEYstatic:

    name of the file keeping your private SSL-key for proxy

  • PROXY_SSLKEYTYPEstatic:

    type of the file keeping your private SSL-key ("DER", "PEM", "ENG") for proxy

  • PROXY_KEYPASSWDstatic:

    password for the SSL private key for proxy

  • PROXY_SSL_CIPHER_LISTstatic:

    Specify which SSL ciphers to use for proxy

  • PROXY_CRLFILEstatic:

    CRL file for proxy

  • PROXY_SSL_OPTIONSstatic:

    Enable/disable specific SSL features with a bitmask for proxy, see CURLSSLOPT_ @static

  • PRE_PROXYstatic:

    Name of pre proxy to use.

  • PROXY_PINNEDPUBLICKEYstatic:

    The public key in DER form used to validate the proxy public key this option is used only if PROXY_SSL_VERIFYPEER is true

  • ABSTRACT_UNIX_SOCKETstatic:

    Path to an abstract Unix domain socket

  • SUPPRESS_CONNECT_HEADERSstatic:

    Suppress proxy CONNECT response headers from user callbacks

  • REQUEST_TARGETstatic:

    The request target, instead of extracted from the URL

  • SOCKS5_AUTHstatic:

    bitmask of allowed auth methods for connections to SOCKS5 proxies

  • SSH_COMPRESSIONstatic:

    Enable/disable SSH compression

  • MIMEPOSTstatic:

    Post MIME data.

  • READDATAstatic:

    The data that will be used as the body of the request.

  • TIMEVALUE_LARGEstatic:

    Time to use with the CURLOPT_TIMECONDITION. Specified in number of seconds since 1 Jan 1970.

  • HAPPY_EYEBALLS_TIMEOUT_MSstatic:

    Head start in milliseconds to give happy eyeballs.

  • HAPROXYPROTOCOLstatic:

    send HAProxy PROXY protocol header?

  • DNS_SHUFFLE_ADDRESSESstatic:

    shuffle addresses before use when DNS returns multiple

  • TLS13_CIPHERSstatic:

    Specify which TLS 1.3 ciphers suites to use

  • PROXY_TLS13_CIPHERSstatic:

    Specify which TLS 1.3 ciphers suites to use with a proxy

  • DISALLOW_USERNAME_IN_URLstatic:

    Disallow specifying username/login in URL.

  • DOH_URLstatic:

    DNS-over-HTTPS URL

  • UPLOAD_BUFFERSIZEstatic:

    Preferred buffer size to use for uploads

  • UPKEEP_INTERVAL_MSstatic:

    Time in ms between connection upkeep calls for long-lived connections.

  • CURLUstatic:

    Specify URL using CURL URL API.

  • HTTP09_ALLOWEDstatic:

    set this to 1L to allow HTTP/0.9 responses or 0L to disallow

  • ALTSVC_CTRLstatic:

    alt-svc control bitmask

  • ALTSVCstatic:

    alt-svc cache file name to possibly read from/write to

  • MAXAGE_CONNstatic:

    maximum age of a connection to consider it for reuse (in seconds)

  • SASL_AUTHZIDstatic:

    SASL authorisation identity