Module luacurl
LuaCURL is a module providing Internet browsing capabilities based on the CURL library.
The module interface follows strictly the CURl architecture and is very easy to use if the programmer has already experience with CURL. The only LuaCURL luaopen_luacurl public function register itself to the Lua context defining a namespace curl with one constructor and some utility functions. COMENT OF THE DOCUMENTOR: Its just not well documented... so I played around with it. I just can't say if this all is right, but luacurl is awful to use! I even appreciate luasocket for this stuff. "(-.-) I also would appreciate somebody who can tell me how to use it correctly to document it correctly
Usages:
require("luacurl")
local curl = require("luacurl")
Type curl
| curl.ABORTED_BY_CALLBACK |
Its a selfdescribing error... |
| curl.ARRAY |
Another possibility to send options is the curl.ARRAY option, that passes a #table of valid options. |
| curl.AUTH_ANY |
This is a convenience macro that sets all bits and thus makes libcurl pick any it finds suitable. |
| curl.AUTH_ANYSAFE |
This is a convenience macro that sets all bits except Basic and thus makes libcurl pick any it finds suitable. |
| curl.AUTH_BASIC |
HTTP Basic authentication. |
| curl.AUTH_DIGEST |
HTTP Digest authentication. |
| curl.AUTH_GSSNEGOTIATE |
HTTP GSS-Negotiate authentication. |
| curl.AUTH_NONE |
No HTTP authentication. |
| curl.AUTH_NTLM |
HTTP NTLM authentication. |
| curl.BAD_CALLING_ORDER |
Its a selfdescribing error... |
| curl.BAD_CONTENT_ENCODING |
Its a selfdescribing error... |
| curl.BAD_DOWNLOAD_RESUME |
Its a selfdescribing error... |
| curl.BAD_FUNCTION_ARGUMENT |
Its a selfdescribing error... |
| curl.BAD_PASSWORD_ENTERED |
Its a selfdescribing error... |
| curl.BUFFER |
It tells libcurl that the file contents are already present in a buffer. |
| curl.BUFFERLENGTH |
The parameter is a #number which gives the length of the buffer. |
| curl.BUFFERPTR |
The parameter is a (pointer) to the buffer to be uploaded. |
| curl.CLOSEPOLICY_CALLBACK |
(obsolete) The callback of curl.OPT_CLOSEPOLICY |
| curl.CLOSEPOLICY_LEAST_RECENTLY_USED |
(obsolete) The least recently used close-policy |
| curl.CLOSEPOLICY_LEAST_TRAFFIC |
(obsolete) The least traffic using close-policy |
| curl.CLOSEPOLICY_OLDEST |
(obsolete) The oldest close-policy |
| curl.CLOSEPOLICY_SLOWEST |
(obsolete) The slowest close-policy |
| curl.CONTENTHEADER |
Specifies extra headers for the form POST section. |
| curl.CONTENTSLENGTH |
The length of the contents. |
| curl.CONTENTTYPE |
The #string which provides the content-type for this part, possibly instead of an internally chosen one. |
| curl.COPYCONTENTS |
The actual data to send away. |
| curl.COPYNAME |
The #string provides the copy-name. |
| curl.COULDNT_CONNECT |
Its a selfdescribing error... |
| curl.COULDNT_RESOLVE_HOST |
Its a selfdescribing error... |
| curl.COULDNT_RESOLVE_PROXY |
Its a selfdescribing error... |
| curl.CURL_FORMADD_DISABLED |
UNDOCUMENTED/NOTHING FOUND |
| curl.CURL_FORMADD_ILLEGAL_ARRAY |
UNDOCUMENTED/NOTHING FOUND |
| curl.CURL_FORMADD_INCOMPLETE |
UNDOCUMENTED/NOTHING FOUND |
| curl.CURL_FORMADD_MEMORY |
UNDOCUMENTED/NOTHING FOUND |
| curl.CURL_FORMADD_NULL |
UNDOCUMENTED/NOTHING FOUND |
| curl.CURL_FORMADD_OK |
UNDOCUMENTED/NOTHING FOUND |
| curl.CURL_FORMADD_OPTION_TWICE |
UNDOCUMENTED/NOTHING FOUND |
| curl.CURL_FORMADD_UNKNOWN_OPTION |
UNDOCUMENTED/NOTHING FOUND |
| curl.END |
Put this at the end of the #table passed to curl.ARRAY. |
| curl.FAILED_INIT |
Its a selfdescribing error... |
| curl.FILE |
Makes this part a file upload part. |
| curl.FILECONTENT |
Causes that file to be read and its contents used as data in this part. |
| curl.FILENAME |
The #string tells libcurl to use the given string as the filename in the file upload part instead of the actual file name. |
| curl.FILESIZE_EXCEEDED |
Its a selfdescribing error... |
| curl.FILE_COULDNT_READ_FILE |
Its a selfdescribing error... |
| curl.FTPAUTH_DEFAULT |
Allow libcurl to decide. |
| curl.FTPAUTH_SSL |
Try "AUTH SSL" first, and only if that fails try "AUTH TLS". |
| curl.FTPAUTH_TLS |
Try "AUTH TLS" first, and only if that fails try "AUTH SSL". |
| curl.FTPSSL_ALL |
Require SSL for all communication. |
| curl.FTPSSL_CONTROL |
Require SSL for the control connection. |
| curl.FTPSSL_NONE |
Don't attempt to use SSL. |
| curl.FTPSSL_TRY |
Try using SSL, proceed as normal otherwise. |
| curl.FTP_ACCESS_DENIED |
Its a selfdescribing error... |
| curl.FTP_CANT_GET_HOST |
Its a selfdescribing error... |
| curl.FTP_CANT_RECONNECT |
Its a selfdescribing error... |
| curl.FTP_COULDNT_GET_SIZE |
Its a selfdescribing error... |
| curl.FTP_COULDNT_RETR_FILE |
Its a selfdescribing error... |
| curl.FTP_COULDNT_SET_ASCII |
Its a selfdescribing error... |
| curl.FTP_COULDNT_SET_BINARY |
Its a selfdescribing error... |
| curl.FTP_COULDNT_STOR_FILE |
Its a selfdescribing error... |
| curl.FTP_COULDNT_USE_REST |
Its a selfdescribing error... |
| curl.FTP_PORT_FAILED |
Its a selfdescribing error... |
| curl.FTP_QUOTE_ERROR |
Its a selfdescribing error... |
| curl.FTP_SSL_FAILED |
Its a selfdescribing error... |
| curl.FTP_USER_PASSWORD_INCORRECT |
Its a selfdescribing error... |
| curl.FTP_WEIRD_227_FORMAT |
Its a selfdescribing error... |
| curl.FTP_WEIRD_PASS_REPLY |
Its a selfdescribing error... |
| curl.FTP_WEIRD_PASV_REPLY |
Its a selfdescribing error... |
| curl.FTP_WEIRD_SERVER_REPLY |
Its a selfdescribing error... |
| curl.FTP_WEIRD_USER_REPLY |
Its a selfdescribing error... |
| curl.FTP_WRITE_ERROR |
Its a selfdescribing error... |
| curl.FUNCTION_NOT_FOUND |
Its a selfdescribing error... |
| curl.GOT_NOTHING |
Its a selfdescribing error... |
| curl.HTTP_POST_ERROR |
Its a selfdescribing error... |
| curl.HTTP_RANGE_ERROR |
Its a selfdescribing error... |
| curl.HTTP_RETURNED_ERROR |
Its a selfdescribing error... |
| curl.HTTP_VERSION_1_0 |
Enforce HTTP 1.0 requests. |
| curl.HTTP_VERSION_1_1 |
Enforce HTTP 1.1 requests. |
| curl.HTTP_VERSION_NONE |
We don't care about what version the library uses. |
| curl.INFO_CONNECT_TIME |
The time, in seconds, it took from the start until the connect to the remote host (or proxy) was completed. |
| curl.INFO_CONTENT_LENGTH_DOWNLOAD |
The content-length of the download. |
| curl.INFO_CONTENT_LENGTH_UPLOAD |
The specified size of the upload. |
| curl.INFO_CONTENT_TYPE |
The content-type of the downloaded object. |
| curl.INFO_COOKIELIST |
Pass a #table of all cookies cURL knows (expired ones, too). |
| curl.INFO_EFFECTIVE_URL |
The last used effective URL. |
| curl.INFO_FILETIME |
The remote time of the retrieved document (in number of seconds since 1 Jan 1970 in the GMT/UTC time zone). |
| curl.INFO_HEADER_SIZE |
The total size of all the headers received. |
| curl.INFO_HTTPAUTH_AVAIL |
Bitmask indicating the authentication method(s) available. |
| curl.INFO_HTTP_CONNECTCODE |
The last received proxy response code to a CONNECT request. |
| curl.INFO_LASTSOCKET |
The last socket used by this curl session. |
| curl.INFO_NAMELOOKUP_TIME |
The time, in seconds, it took from the start until the name resolving was completed. |
| curl.INFO_NONE |
|
| curl.INFO_NUM_CONNECTS |
How many new connections libcurl had to create to achieve the previous transfer (only the successful connects are counted). |
| curl.INFO_OS_ERRNO |
The errno variable from a connect failure. |
| curl.INFO_PRETRANSFER_TIME |
The time, in seconds, it took from the start until the file transfer is just about to begin. |
| curl.INFO_PRIVATE |
The pointer to the private data associated with the curl handle. |
| curl.INFO_PROXYAUTH_AVAIL |
Bitmask indicating the authentication method(s) available for your proxy authentication. |
| curl.INFO_REDIRECT_COUNT |
The total number of redirections that were actually followed. |
| curl.INFO_REDIRECT_TIME |
The total time, in seconds, it took for all redirection steps include name lookup, connect, pretransfer and transfer before final transaction was started. |
| curl.INFO_REQUEST_SIZE |
The total size of the issued requests. |
| curl.INFO_RESPONSE_CODE |
The last received HTTP, FTP or SMTP response code. |
| curl.INFO_SIZE_DOWNLOAD |
The total amount of bytes that were downloaded. |
| curl.INFO_SIZE_UPLOAD |
The total amount of bytes that were uploaded. |
| curl.INFO_SPEED_DOWNLOAD |
The average download speed that curl measured for the complete download. |
| curl.INFO_SPEED_UPLOAD |
The average upload speed that curl measured for the complete upload. |
| curl.INFO_SSL_ENGINES |
Pass a #table of OpenSSL crypto-engines supported. |
| curl.INFO_SSL_VERIFYRESULT |
The result of the certification verification that was requested (using the curl.OPTSSLVERIFYPEER option to curlobj.setopt). |
| curl.INFO_STARTTRANSFER_TIME |
The time, in seconds, it took from the start until the first byte is received by libcurl. |
| curl.INFO_TOTAL_TIME |
The total time in seconds for the previous transfer, including name resolving, TCP connect etc. |
| curl.INTERFACE_FAILED |
Its a selfdescribing error... |
| curl.IOCMD_NOP |
UNDOCUMENTED/NOTHING FOUND |
| curl.IOCMD_RESTARTREAD |
UNDOCUMENTED/NOTHING FOUND |
| curl.IOE_FAILRESTART |
UNDOCUMENTED/NOTHING FOUND |
| curl.IOE_OK |
UNDOCUMENTED/NOTHING FOUND |
| curl.IOE_UNKNOWNCMD |
UNDOCUMENTED/NOTHING FOUND |
| curl.IPRESOLVE_V4 |
Resolve to IPv4 addresses. |
| curl.IPRESOLVE_V6 |
Resolve to IPv6 addresses. |
| curl.IPRESOLVE_WHATEVER |
Default, resolves addresses to all IP versions that your system allows. |
| curl.LDAP_CANNOT_BIND |
Its a selfdescribing error... |
| curl.LDAP_INVALID_URL |
Its a selfdescribing error... |
| curl.LDAP_SEARCH_FAILED |
Its a selfdescribing error... |
| curl.LIBRARY_NOT_FOUND |
Its a selfdescribing error... |
| curl.LOGIN_DENIED |
Its a selfdescribing error... |
| curl.MALFORMAT_USER |
Its a selfdescribing error... |
| curl.NAMELENGTH |
UNDOCUMENTED/NOTHING FOUND |
| curl.NETRC_IGNORED |
The library will ignore the file and use only the information in the URL. |
| curl.NETRC_OPTIONAL |
The use of your ~/.netrc file is optional, and information in the URL is to be preferred. |
| curl.NETRC_REQUIRED |
This value tells the library that use of the file is required, to ignore the information in the curl.OPT_URL, and to search the file for the host only. |
| curl.OBSOLETE |
UNDOCUMENTED/NOTHING FOUND |
| curl.OBSOLETE2 |
UNDOCUMENTED/NOTHING FOUND |
| curl.OK |
Returnd by any #curl related function to say anything went well. |
| curl.OPERATION_TIMEOUTED |
Its a selfdescribing error... |
| curl.OPT_AUTOREFERER |
Pass a #boolean set to true to enable this. |
| curl.OPT_BUFFERSIZE |
Pass a #number specifying your preferred size (in bytes) for the receive buffer in libcurl. |
| curl.OPT_CAINFO |
Pass a #string naming a file holding one or more certificates to verify the peer with. |
| curl.OPT_CAPATH |
Pass a #string naming a directory holding multiple CA certificates to verify the peer with. |
| curl.OPT_CLOSEPOLICY |
(Obsolete) This option does nothing. |
| curl.OPT_CONNECTTIMEOUT |
The #number should contain the maximum time in seconds that you allow the connection to the server to take. |
| curl.OPT_COOKIE |
It will be used to set a cookie in the http request. |
| curl.OPT_COOKIEFILE |
The #string should contain the name of your file holding cookie data to read. |
| curl.OPT_COOKIEJAR |
Pass a file name as #string. |
| curl.OPT_COOKIESESSION |
Pass a #boolean set to true to mark this as a new cookie "session". |
| curl.OPT_CRLF |
If the value is set to true, libcurl converts Unix newlines to CRLF newlines on transfers. |
| curl.OPT_CUSTOMREQUEST |
The #string can be used to specify the request instead of GET or HEAD when performing HTTP based requests, instead of LIST and NLST when performing FTP directory listings and instead of LIST and RETR when issuing POP3 based commands. |
| curl.OPT_DNS_CACHE_TIMEOUT |
This sets the timeout in seconds. |
| curl.OPT_DNS_USE_GLOBAL_CACHE |
If the value is true, it tells curl to use a global DNS cache that will survive between easy handle creations and deletions. |
| curl.OPT_EGDSOCKET |
Pass a path name to the Entropy Gathering Daemon socket. |
| curl.OPT_ENCODING |
_It has got an update... |
| curl.OPT_FAILONERROR |
A parameter set to true tells the library to fail silently if the HTTP code returned is equal to or larger than 400. |
| curl.OPT_FILETIME |
If the #boolean is true, libcurl will attempt to get the modification date of the remote document in this operation. |
| curl.OPT_FOLLOWLOCATION |
A #boolean set to true tells the library to follow any Location: header that the server sends as part of a HTTP header. |
| curl.OPT_FORBID_REUSE |
Set to ture to make the next transfer explicitly close the connection when done. |
| curl.OPT_FRESH_CONNECT |
Set to true to make the next transfer use a new (fresh) connection by force. |
| curl.OPT_FTPAPPEND |
A parameter set to true tells the library to append to the remote file instead of overwrite it. |
| curl.OPT_FTPLISTONLY |
A parameter set to true tells the library to just list the names of files in a directory, instead of doing a full directory listing that would include file sizes, dates etc. |
| curl.OPT_FTPPORT |
The #string will be used to get the IP address to use for the FTP PORT instruction. |
| curl.OPT_FTPSSLAUTH |
Pass a #number using one of the values from below, to alter how libcurl issues "AUTH TLS" or "AUTH SSL" when FTP over SSL is activated . |
| curl.OPT_FTP_ACCOUNT |
When an FTP server asks for "account data" after user name and password has been provided, this data is sent off using the ACCT command. |
| curl.OPT_FTP_CREATE_MISSING_DIRS |
If the value is true, curl will attempt to create any remote directory that it fails to CWD into. |
| curl.OPT_FTP_RESPONSE_TIMEOUT |
Causes curl to set a timeout period (in seconds) on the amount of time that the server is allowed to take in order to generate a response message for a command before the session is considered hung. |
| curl.OPT_FTP_SSL |
Pass a #number using one of the values from below, to make libcurl use your desired level of SSL for the transfer. |
| curl.OPT_FTP_USE_EPRT |
If the value is true, it tells curl to use the EPRT (and LPRT) command when doing active FTP downloads (which is enabled by curl.OPT_FTPPORT). |
| curl.OPT_FTP_USE_EPSV |
If the value is true, it tells curl to use the EPSV command when doing passive FTP downloads (which it always does by default). |
| curl.OPT_HEADER |
A parameter set to true tells the library to include the header in the body output. |
| curl.OPT_HEADERDATA |
Userparam of curl.OPT_HEADERFUNCTION
|
| curl.OPT_HEADERFUNCTION |
This function gets called by libcurl as soon as it has received header data. |
| curl.OPT_HTTP200ALIASES |
List of aliases to be treated as valid HTTP 200 responses. |
| curl.OPT_HTTPAUTH |
Pass a long as parameter, which is set to a bitmask, to tell libcurl which authentication method(s) you want it to use. |
| curl.OPT_HTTPGET |
If the #boolean is true, this forces the HTTP request to get back to GET. |
| curl.OPT_HTTPHEADER |
HTTP headers to pass to the server in your HTTP request. |
| curl.OPT_HTTPPOST |
Tells libcurl you want a multipart/formdata HTTP POST to be made and you instruct what data to pass on to the server. |
| curl.OPT_HTTPPROXYTUNNEL |
Set the parameter to true to make the library tunnel all operations through a given HTTP proxy. |
| curl.OPT_HTTP_VERSION |
Pass a #number, set to one of the values described below. |
| curl.OPT_INFILESIZE |
When uploading a file to a remote site, this option should be used to tell libcurl what the expected size of the infile is. |
| curl.OPT_INFILESIZE_LARGE |
When uploading a file to a remote site, this option should be used to tell libcurl what the expected size of the infile is. |
| curl.OPT_INTERFACE |
This sets the interface name to use as outgoing network interface. |
| curl.OPT_IOCTLDATA |
Pass a pointer that will be untouched by libcurl and passed as the 3rd argument in the ioctl callback set with CURLOPT_IOCTLFUNCTION. |
| curl.OPT_IOCTLFUNCTION |
This function gets called by libcurl when something special I/O-related needs to be done that the library can't do by itself. |
| curl.OPT_IPRESOLVE |
Allows an application to select what kind of IP addresses to use when resolving host names. |
| curl.OPT_KRB4LEVEL |
_It has got an update... |
| curl.OPT_LOW_SPEED_LIMIT |
The #number contains the transfer speed in bytes per second that the transfer should be below during curl.OPTLOWSPEED_TIME seconds for the library to consider it too slow and abort. |
| curl.OPT_LOW_SPEED_TIME |
The #number contains the time in seconds that the transfer should be below the curl.OPTLOWSPEED_LIMIT for the library to consider it too slow and abort. |
| curl.OPT_MAXCONNECTS |
The set number will be the persistent connection cache size. |
| curl.OPT_MAXFILESIZE |
This allows you to specify the maximum size (in bytes) of a file to download. |
| curl.OPT_MAXFILESIZE_LARGE |
This allows you to specify the maximum size (in bytes) of a file to download. |
| curl.OPT_MAXREDIRS |
Pass a #number. |
| curl.OPT_NETRC |
This parameter controls the preference of libcurl between using user names and passwords from your ~/.netrc file, relative to user names and passwords in the URL supplied with curl.OPT_URL. |
| curl.OPT_NETRC_FILE |
The full path name to the file you want libcurl to use as .netrc file. |
| curl.OPT_NOBODY |
A #boolean set to true tells the library to not include the body-part in the output. |
| curl.OPT_NOPROGRESS |
If set to true, it tells the library to shut off the progress meter completely. |
| curl.OPT_NOSIGNAL |
If it is true, libcurl will not use any functions that install signal handlers or any functions that cause signals to be sent to the process. |
| curl.OPT_PORT |
Pass a #number specifying what remote port #number to connect to, instead of the one specified in the curl.OPT_URL or the default port for the used protocol. |
| curl.OPT_POST |
A #boolean set to true tells the library to do a regular HTTP post. |
| curl.OPT_POSTFIELDS |
The full data to post in a HTTP POST operation. |
| curl.OPT_POSTFIELDSIZE |
If you want to post data to the server without letting libcurl do a strlen() (C-function, similar to string.len() in Lua) to measure the data size, this option must be used. |
| curl.OPT_POSTFIELDSIZE_LARGE |
Use this to set the size of the curl.OPT_POSTFIELDS data to prevent libcurl from doing strlen() (C-function, similar to string.len() in Lua) on the data to figure out the size. |
| curl.OPT_POSTQUOTE |
Pass a list of FTP or SFTP commands to pass to the server after your FTP transfer request. |
| curl.OPT_PREQUOTE |
Pass a list of FTP commands to pass to the server after the transfer type is set. |
| curl.OPT_PROGRESSDATA |
userparam of curl.OPT_PROGRESSFUNCTION
|
| curl.OPT_PROGRESSFUNCTION |
This function gets called by libcurl instead of its internal equivalent with a frequent interval. |
| curl.OPT_PROXY |
IP-address of the proxy. |
| curl.OPT_PROXYAUTH |
Pass a #number as parameter, which is set to a bitmask, to tell libcurl which authentication method(s) you want it to use for your proxy authentication. |
| curl.OPT_PROXYPORT |
Set the proxy port to connect to unless it is specified in the proxy #string curl.OPT_PROXY. |
| curl.OPT_PROXYTYPE |
Available options for this are: |
| curl.OPT_PROXYUSERPWD |
The #string should be [user name]:[password] to use for the connection to the HTTP proxy. |
| curl.OPT_PUT |
A #boolean set to true tells the library to use HTTP PUT to transfer data. |
| curl.OPT_QUOTE |
Pass a list of FTP or SFTP commands to pass to the server prior to your FTP request. |
| curl.OPT_RANDOM_FILE |
Pass a file name. |
| curl.OPT_RANGE |
Pass a #string as parameter, which should contain the specified range you want. |
| curl.OPT_READDATA |
userparam to pass to the file read function. |
| curl.OPT_READFUNCTION |
This function gets called by libcurl as soon as it needs to read data in order to send it to the peer. |
| curl.OPT_REFERER |
It will be used to set the Referer: header in the http request sent to the remote server. |
| curl.OPT_RESUME_FROM |
The #number contains the offset in number of bytes that you want the transfer to start from. |
| curl.OPT_RESUME_FROM_LARGE |
The #number contains the offset in number of bytes that you want the transfer to start from. |
| curl.OPT_SOURCE_POSTQUOTE |
I cannot find anything about this... |
| curl.OPT_SOURCE_PREQUOTE |
I cannot find anything about this... |
| curl.OPT_SOURCE_QUOTE |
I cannot find anything about this... |
| curl.OPT_SOURCE_URL |
I cannot find anything about this... |
| curl.OPT_SOURCE_USERPWD |
Login details #string for the connection. |
| curl.OPT_SSLCERT |
The #string should be the file name of your certificate. |
| curl.OPT_SSLCERTTYPE |
The #string should be the format of your certificate. |
| curl.OPT_SSLENGINE |
It will be used as the identifier for the crypto engine you want to use for your private key. |
| curl.OPT_SSLENGINE_DEFAULT |
Sets the actual crypto engine as the default for (asymmetric) crypto operations. |
| curl.OPT_SSLKEY |
The #string should be the file name of your private key. |
| curl.OPT_SSLKEYPASSWD |
It will be used as the password required to use the curl.OPT_SSLKEY or private key. |
| curl.OPT_SSLKEYTYPE |
The #string should be the format of your private key. |
| curl.OPT_SSLVERSION |
Pass a šnumber as parameter to control what version of SSL/TLS to attempt to use. |
| curl.OPT_SSL_CIPHER_LIST |
Pass a #string holding the list of ciphers to use for the SSL connection. |
| curl.OPT_SSL_VERIFYHOST |
This option determines whether libcurl verifies that the server cert is for the server it is known as. |
| curl.OPT_SSL_VERIFYPEER |
This option determines whether curl verifies the authenticity of the peer's certificate. |
| curl.OPT_TCP_NODELAY |
Pass a #number specifying whether the curl.OPTTCPNODELAY option is to be set or cleared (true = set, false = clear). |
| curl.OPT_TELNETOPTIONS |
Provide a pointer to a list with variables to pass to the telnet negotiations. |
| curl.OPT_TIMECONDITION |
This defines how the curl.OPT_TIMEVALUE time value is treated. |
| curl.OPT_TIMEOUT |
Pass a #number as parameter containing the maximum time in seconds that you allow the libcurl transfer operation to take. |
| curl.OPT_TIMEVALUE |
This should be the time in seconds since 1 Jan 1970, and the time will be used in a condition as specified with curl.OPT_TIMECONDITION. |
| curl.OPT_TRANSFERTEXT |
A #boolean set to true tells the library to use ASCII mode for FTP transfers, instead of the default binary transfer. |
| curl.OPT_UNRESTRICTED_AUTH |
A #boolean set to true tells the library it can continue to send authentication (user+password) when following locations, even when hostname changed. |
| curl.OPT_UPLOAD |
A parameter set to 1 tells the library to prepare for an upload. |
| curl.OPT_URL |
The URL used to receive/send data. |
| curl.OPT_USERAGENT |
It will be used to set the User-Agent: header in the http request sent to the remote server. |
| curl.OPT_USERPWD |
|
| curl.OPT_VERBOSE |
Set the parameter to true to get the library to display a lot of verbose information about its operations. |
| curl.OPT_WRITEDATA |
userparam to pass to the file write function. |
| curl.OPT_WRITEFUNCTION |
This function gets called by libcurl as soon as there is data received that needs to be saved. |
| curl.OPT_WRITEINFO |
I am not sure... |
| curl.OUT_OF_MEMORY |
Its a selfdescribing error... |
| curl.PARTIAL_FILE |
Its a selfdescribing error... |
| curl.PROXY_HTTP |
HTTP-type proxy |
| curl.PROXY_SOCKS4 |
SOCKS4-type proxy |
| curl.PROXY_SOCKS5 |
SOCKS5-type proxy |
| curl.PTRCONTENTS |
The actual data to send away. |
| curl.PTRNAME |
The #string provides the pointer-name. |
| curl.READFUNC_ABORT |
Aborts the read-function. |
| curl.READ_ERROR |
Its a selfdescribing error... |
| curl.SEND_ERROR |
Its a selfdescribing error... |
| curl.SEND_FAIL_REWIND |
Its a selfdescribing error... |
| curl.SHARE_IN_USE |
Its a selfdescribing error... |
| curl.SSLVERSION_DEFAULT |
The default action. |
| curl.SSLVERSION_SSLv2 |
Force SSLv2 |
| curl.SSLVERSION_SSLv3 |
Force SSLv3 |
| curl.SSLVERSION_TLSv1 |
Force TLSv1 |
| curl.SSL_CACERT |
Its a selfdescribing error... |
| curl.SSL_CERTPROBLEM |
Its a selfdescribing error... |
| curl.SSL_CIPHER |
Its a selfdescribing error... |
| curl.SSL_CONNECT_ERROR |
Its a selfdescribing error... |
| curl.SSL_ENGINE_INITFAILED |
Its a selfdescribing error... |
| curl.SSL_ENGINE_NOTFOUND |
Its a selfdescribing error... |
| curl.SSL_ENGINE_SETFAILED |
Its a selfdescribing error... |
| curl.SSL_PEER_CERTIFICATE |
UNDOCUMENTED/NOTHING FOUND |
| curl.TELNET_OPTION_SYNTAX |
Its a selfdescribing error... |
| curl.TIMECOND_IFMODSINCE |
Condition: If modified since ? |
| curl.TIMECOND_IFUNMODSINCE |
Condition: If unmodified since ? |
| curl.TIMECOND_LASTMOD |
Condition: last modified |
| curl.TIMECOND_NONE |
No time condition |
| curl.TOO_MANY_REDIRECTS |
Its a selfdescribing error... |
| curl.UNKNOWN_TELNET_OPTION |
Its a selfdescribing error... |
| curl.UNSUPPORTED_PROTOCOL |
Its a selfdescribing error... |
| curl.URL_MALFORMAT |
Its a selfdescribing error... |
| curl.URL_MALFORMAT_USER |
Its a selfdescribing error... |
| curl.WRITE_ERROR |
Its a selfdescribing error... |
| curl._COPYRIGHT |
Copyright information of this module. |
| curl._CURLVERSION |
The current used CURL version for this module. |
| curl._DESCRIPTION |
A description of this module. |
| curl._NAME |
The name of this module. |
| curl._SUPPORTED_CURLVERSION |
The supported CURL version of this module. |
| curl._VERSION |
The current version of luacurl. |
| curl.escape(url) |
Escapes URL #strings. |
| curl.new() |
Use this function to instantiate curl objects. |
| curl.unescape(url) |
Unescapes URL encoding in #strings. |
Type curlobj
| curlobj.close() |
This function closes a curl connection created by curl.new |
| curlobj.getinfo(info) |
Get informations for the #curlobj. |
| curlobj.perform() |
Call this method to perform a file transfer after all curlobj.setopt calls are made. |
| curlobj.setopt(option, ...) |
Sets options for the #curlobj to be used on the curlobj.perform function. |
Type luacurl
Type #
The CURL-object to used for curl-actions and settings
Type curl
Field(s)
- #number curl.ABORTED_BY_CALLBACK
-
Its a selfdescribing error...
- #number curl.ARRAY
-
Another possibility to send options is the curl.ARRAY option, that passes a #table of valid options.
Each curl_forms structure element has a CURLformoption and a char pointer. The final element in the array must be a curl.END. All available options can be used in an array, except the curl.ARRAY option itself! The last argument in such an array must always be curl.END.
needs: #table (with at end)
- #number curl.AUTH_ANY
-
This is a convenience macro that sets all bits and thus makes libcurl pick any it finds suitable.
libcurl will automatically select the one it finds most secure.
Used for curl.OPT_HTTPAUTH
- #number curl.AUTH_ANYSAFE
-
This is a convenience macro that sets all bits except Basic and thus makes libcurl pick any it finds suitable.
libcurl will automatically select the one it finds most secure.
Used for curl.OPT_HTTPAUTH
- #number curl.AUTH_BASIC
-
HTTP Basic authentication.
This is the default choice, and the only method that is in wide-spread use and supported virtually everywhere. This sends the user name and password over the network in plain text, easily captured by others.
Used for curl.OPT_HTTPAUTH
- #number curl.AUTH_DIGEST
-
HTTP Digest authentication.
Digest authentication is defined in RFC 2617 and is a more secure way to do authentication over public networks than the regular old-fashioned Basic method.
Used for curl.OPT_HTTPAUTH
- #number curl.AUTH_GSSNEGOTIATE
-
HTTP GSS-Negotiate authentication.
The GSS-Negotiate (also known as plain "Negotiate") method was designed by Microsoft and is used in their web applications. It is primarily meant as a support for Kerberos5 authentication but may also be used along with other authentication methods. For more information see IETF draft draft-brezak-spnego-http-04.txt.
You need to build libcurl with a suitable GSS-API library for this to work.
Used for curl.OPT_HTTPAUTH
- #number curl.AUTH_NONE
-
No HTTP authentication.
Used for curl.OPT_HTTPAUTH
- #number curl.AUTH_NTLM
-
HTTP NTLM authentication.
A proprietary protocol invented and used by Microsoft. It uses a challenge-response and hash concept similar to Digest, to prevent the password from being eavesdropped.
You need to build libcurl with either OpenSSL, GnuTLS or NSS support for this option to work, or build libcurl on Windows with SSPI support.
Used for curl.OPT_HTTPAUTH
- #number curl.BAD_CALLING_ORDER
-
Its a selfdescribing error...
- #number curl.BAD_CONTENT_ENCODING
-
Its a selfdescribing error...
- #number curl.BAD_DOWNLOAD_RESUME
-
Its a selfdescribing error...
- #number curl.BAD_FUNCTION_ARGUMENT
-
Its a selfdescribing error...
- #number curl.BAD_PASSWORD_ENTERED
-
Its a selfdescribing error...
- #number curl.BUFFER
-
It tells libcurl that the file contents are already present in a buffer.
This is used for custom file upload parts without use of curl.FILE.
needs: #string (filename)
- #number curl.BUFFERLENGTH
-
The parameter is a #number which gives the length of the buffer.
This is used in combination with curl.BUFFER.
needs: #number
- #number curl.BUFFERPTR
-
The parameter is a (pointer) to the buffer to be uploaded.
This buffer must not be freed until after curlobj.close is called. You must also use curl.BUFFERLENGTH to set the number of bytes in the buffer. This is used in combination with curl.BUFFER.
- #number curl.CLOSEPOLICY_CALLBACK
-
(obsolete) The callback of curl.OPT_CLOSEPOLICY
Used for curl.OPT_CLOSEPOLICY
- #number curl.CLOSEPOLICY_LEAST_RECENTLY_USED
-
(obsolete) The least recently used close-policy
Used for curl.OPT_CLOSEPOLICY
- #number curl.CLOSEPOLICY_LEAST_TRAFFIC
-
(obsolete) The least traffic using close-policy
Used for curl.OPT_CLOSEPOLICY
- #number curl.CLOSEPOLICY_OLDEST
-
(obsolete) The oldest close-policy
Used for curl.OPT_CLOSEPOLICY
- #number curl.CLOSEPOLICY_SLOWEST
-
(obsolete) The slowest close-policy
Used for curl.OPT_CLOSEPOLICY
- #number curl.CONTENTHEADER
-
Specifies extra headers for the form POST section.
This takes a #table. The list must exist while the POST occurs, if you free it before the post completes you may experience problems.
When you've passed the HttpPost pointer to curlobj.setopt (using the curl.OPT_HTTPPOST option), you must not free the list until after you've called curlobj.close for the curl handle.
needs: #table
- #number curl.CONTENTSLENGTH
-
The length of the contents.
needs: #number
- #number curl.CONTENTTYPE
-
The #string which provides the content-type for this part, possibly instead of an internally chosen one.
This is used in combination with curl.FILE.
needs: #string
- #number curl.COPYCONTENTS
-
The actual data to send away.
libcurl copies the provided data, so your application doesn't need to keep it around after this function call. If the data isn't null terminated, or if you'd like it to contain zero bytes, you must set the length of the name with curl.CONTENTSLENGTH.
needs: #table
- #number curl.COPYNAME
-
The #string provides the copy-name.
libcurl copies the string so your application doesn't need to keep it around after this function call.
needs: #string
- #number curl.COULDNT_CONNECT
-
Its a selfdescribing error...
- #number curl.COULDNT_RESOLVE_HOST
-
Its a selfdescribing error...
- #number curl.COULDNT_RESOLVE_PROXY
-
Its a selfdescribing error...
- #number curl.CURL_FORMADD_DISABLED
-
UNDOCUMENTED/NOTHING FOUND
- #number curl.CURL_FORMADD_ILLEGAL_ARRAY
-
UNDOCUMENTED/NOTHING FOUND
- #number curl.CURL_FORMADD_INCOMPLETE
-
UNDOCUMENTED/NOTHING FOUND
- #number curl.CURL_FORMADD_MEMORY
-
UNDOCUMENTED/NOTHING FOUND
- #number curl.CURL_FORMADD_NULL
-
UNDOCUMENTED/NOTHING FOUND
- #number curl.CURL_FORMADD_OK
-
UNDOCUMENTED/NOTHING FOUND
- #number curl.CURL_FORMADD_OPTION_TWICE
-
UNDOCUMENTED/NOTHING FOUND
- #number curl.CURL_FORMADD_UNKNOWN_OPTION
-
UNDOCUMENTED/NOTHING FOUND
- #number curl.END
-
Put this at the end of the #table passed to curl.ARRAY.
- #number curl.FAILED_INIT
-
Its a selfdescribing error...
- #number curl.FILE
-
Makes this part a file upload part.
It sets the filename field to the basename of the provided filename, it reads the contents of the file and passes them as data and sets the content-type if the given file match one of the internally known file extensions. For curl.FILE the user may send one or more files in one part by providing multiple curl.FILE arguments each followed by the filename (and each curl.FILE is allowed to have a curl.CONTENTTYPE).
needs: #string (filename)
- #number curl.FILECONTENT
-
Causes that file to be read and its contents used as data in this part.
This part does not automatically become a file upload part simply because its data was read from a file.
needs: #string (filename)
- #number curl.FILENAME
-
The #string tells libcurl to use the given string as the filename in the file upload part instead of the actual file name.
This is used in combination with curl.FILE.
needs: #string
- #number curl.FILESIZE_EXCEEDED
-
Its a selfdescribing error...
- #number curl.FILE_COULDNT_READ_FILE
-
Its a selfdescribing error...
- #number curl.FTPAUTH_DEFAULT
-
Allow libcurl to decide.
Used for curl.OPT_FTPSSLAUTH
- #number curl.FTPAUTH_SSL
-
Try "AUTH SSL" first, and only if that fails try "AUTH TLS".
Used for curl.OPT_FTPSSLAUTH
- #number curl.FTPAUTH_TLS
-
Try "AUTH TLS" first, and only if that fails try "AUTH SSL".
Used for curl.OPT_FTPSSLAUTH
- #number curl.FTPSSL_ALL
-
Require SSL for all communication.
Used for curl.OPTFTPSSL
- #number curl.FTPSSL_CONTROL
-
Require SSL for the control connection.
Used for curl.OPTFTPSSL
- #number curl.FTPSSL_NONE
-
Don't attempt to use SSL.
Used for curl.OPTFTPSSL
- #number curl.FTPSSL_TRY
-
Try using SSL, proceed as normal otherwise.
Used for curl.OPTFTPSSL
- #number curl.FTP_ACCESS_DENIED
-
Its a selfdescribing error...
- #number curl.FTP_CANT_GET_HOST
-
Its a selfdescribing error...
- #number curl.FTP_CANT_RECONNECT
-
Its a selfdescribing error...
- #number curl.FTP_COULDNT_GET_SIZE
-
Its a selfdescribing error...
- #number curl.FTP_COULDNT_RETR_FILE
-
Its a selfdescribing error...
- #number curl.FTP_COULDNT_SET_ASCII
-
Its a selfdescribing error...
- #number curl.FTP_COULDNT_SET_BINARY
-
Its a selfdescribing error...
- #number curl.FTP_COULDNT_STOR_FILE
-
Its a selfdescribing error...
- #number curl.FTP_COULDNT_USE_REST
-
Its a selfdescribing error...
- #number curl.FTP_PORT_FAILED
-
Its a selfdescribing error...
- #number curl.FTP_QUOTE_ERROR
-
Its a selfdescribing error...
- #number curl.FTP_SSL_FAILED
-
Its a selfdescribing error...
- #number curl.FTP_USER_PASSWORD_INCORRECT
-
Its a selfdescribing error...
- #number curl.FTP_WEIRD_227_FORMAT
-
Its a selfdescribing error...
- #number curl.FTP_WEIRD_PASS_REPLY
-
Its a selfdescribing error...
- #number curl.FTP_WEIRD_PASV_REPLY
-
Its a selfdescribing error...
- #number curl.FTP_WEIRD_SERVER_REPLY
-
Its a selfdescribing error...
- #number curl.FTP_WEIRD_USER_REPLY
-
Its a selfdescribing error...
- #number curl.FTP_WRITE_ERROR
-
Its a selfdescribing error...
- #number curl.FUNCTION_NOT_FOUND
-
Its a selfdescribing error...
- #number curl.GOT_NOTHING
-
Its a selfdescribing error...
- #number curl.HTTP_POST_ERROR
-
Its a selfdescribing error...
- #number curl.HTTP_RANGE_ERROR
-
Its a selfdescribing error...
- #number curl.HTTP_RETURNED_ERROR
-
Its a selfdescribing error...
- #number curl.HTTP_VERSION_1_0
-
Enforce HTTP 1.0 requests.
Used for curl.OPTHTTPVERSION
- #number curl.HTTP_VERSION_1_1
-
Enforce HTTP 1.1 requests.
Used for curl.OPTHTTPVERSION
- #number curl.HTTP_VERSION_NONE
-
We don't care about what version the library uses.
libcurl will use whatever it thinks fit.
Used for curl.OPTHTTPVERSION
- #number curl.INFO_CONNECT_TIME
-
The time, in seconds, it took from the start until the connect to the remote host (or proxy) was completed.
Used as parameter for curlobj.getinfo
- #number curl.INFO_CONTENT_LENGTH_DOWNLOAD
-
The content-length of the download.
This is the value read from the Content-Length: field. Since 7.19.4, this returns -1 if the size isn't known.
Used as parameter for curlobj.getinfo
- #number curl.INFO_CONTENT_LENGTH_UPLOAD
-
The specified size of the upload.
Since 7.19.4, this returns -1 if the size isn't known.
Used as parameter for curlobj.getinfo
- #number curl.INFO_CONTENT_TYPE
-
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.
Used as parameter for curlobj.getinfo
- #number curl.INFO_COOKIELIST
-
Pass a #table of all cookies cURL knows (expired ones, too).
If there are no cookies (cookies for the handle have not been enabled or simply none have been received) it will return #nil. (Added in 7.14.1)
Used as parameter for curlobj.getinfo
- #number curl.INFO_EFFECTIVE_URL
-
The last used effective URL.
Used as parameter for curlobj.getinfo
- #number curl.INFO_FILETIME
-
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 (unknown, the server hides it or the server doesn't support the command that tells document time etc) and the time of the document is unknown. Note that you must tell the server to collect this information before the transfer is made, by using the curl.OPT_FILETIME option to curlobj.setopt or you will unconditionally get a -1 back. (Added in 7.5)
Used as parameter for curlobj.getinfo
- #number curl.INFO_HEADER_SIZE
-
The total size of all the headers received.
Measured in number of bytes.
Used as parameter for curlobj.getinfo
- #number curl.INFO_HTTPAUTH_AVAIL
-
Bitmask indicating the authentication method(s) available.
The meaning of the bits is explained in the curl.OPT_HTTPAUTH option for curlobj.setopt. (Added in 7.10.8)
Used as parameter for curlobj.getinfo
- #number curl.INFO_HTTP_CONNECTCODE
-
The last received proxy response code to a CONNECT request.
Used as parameter for curlobj.getinfo
- #number curl.INFO_LASTSOCKET
-
The last socket used by this curl session.
If the socket is no longer valid, -1 is returned. When you finish working with the socket, you must call curlobj.close as usual and let libcurl close the socket and cleanup other resources associated with the handle.
NOTE: this API is not really working on win64, since the SOCKET type on win64 is 64 bit large while its 'long' is only 32 bits.
Used as parameter for curlobj.getinfo
- #number curl.INFO_NAMELOOKUP_TIME
-
The time, in seconds, it took from the start until the name resolving was completed.
Used as parameter for curlobj.getinfo
- #number curl.INFO_NONE
-
Used as parameter for curlobj.getinfo
- #number curl.INFO_NUM_CONNECTS
-
How many new connections libcurl had to create to achieve the previous transfer (only the successful connects are counted).
Combined with curl.INFOREDIRECTCOUNT you are able to know how many times libcurl successfully reused existing connection(s) or not. See the Connection Options of curlobj.setopt to see how libcurl tries to make persistent connections to save time. (Added in 7.12.3)
Used as parameter for curlobj.getinfo
- #number curl.INFO_OS_ERRNO
-
The errno variable from a connect failure.
Note that the value is only set on failure, it is not reset upon a successful operation. (Added in 7.12.2)
Used as parameter for curlobj.getinfo
- #number curl.INFO_PRETRANSFER_TIME
-
The time, in seconds, it took 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.
Used as parameter for curlobj.getinfo
- #number curl.INFO_PRIVATE
-
The pointer to the private data associated with the curl handle.
As curl.OPT_PRIVATE is missing, you can't use it...
Used as parameter for curlobj.getinfo
- #number curl.INFO_PROXYAUTH_AVAIL
-
Bitmask indicating the authentication method(s) available for your proxy authentication.
(Added in 7.10.8)
Used as parameter for curlobj.getinfo
- #number curl.INFO_REDIRECT_COUNT
-
The total number of redirections that were actually followed.
(Added in 7.9.7)
Used as parameter for curlobj.getinfo
- #number curl.INFO_REDIRECT_TIME
-
The total time, in seconds, it took for all redirection steps include name lookup, connect, pretransfer and transfer before final transaction was started.
curl.INFOREDIRECTTIME} contains the complete execution time for multiple
redirections. (Added in 7.9.7)
Used as parameter for curlobj.getinfo
- #number curl.INFO_REQUEST_SIZE
-
The total size of the issued requests.
This is so far only for HTTP requests. Note that this may be more than one request if FOLLOWLOCATION is true.
Used as parameter for curlobj.getinfo
- #number curl.INFO_RESPONSE_CODE
-
The last received HTTP, FTP or SMTP response code.
This option was previously known as CURLINFOHTTPCODE in libcurl 7.10.7 and earlier. The value will be zero if no server response code has been received. Note that a proxy's CONNECT response should be read with curl.INFOHTTPCONNECTCODE and not this.
Used as parameter for curlobj.getinfo
- #number curl.INFO_SIZE_DOWNLOAD
-
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.
Used as parameter for curlobj.getinfo
- #number curl.INFO_SIZE_UPLOAD
-
The total amount of bytes that were uploaded.
Used as parameter for curlobj.getinfo
- #number curl.INFO_SPEED_DOWNLOAD
-
The average download speed that curl measured for the complete download.
Measured in bytes/second.
Used as parameter for curlobj.getinfo
- #number curl.INFO_SPEED_UPLOAD
-
The average upload speed that curl measured for the complete upload.
Measured in bytes/second.
Used as parameter for curlobj.getinfo
- #number curl.INFO_SSL_ENGINES
-
Pass a #table of OpenSSL crypto-engines supported.
Note that engines are normally implemented in separate dynamic libraries. Hence not all the returned engines may be available at run-time.
Used as parameter for curlobj.getinfo
- #number curl.INFO_SSL_VERIFYRESULT
-
The result of the certification verification that was requested (using the curl.OPTSSLVERIFYPEER option to curlobj.setopt).
Used as parameter for curlobj.getinfo
- #number curl.INFO_STARTTRANSFER_TIME
-
The time, in seconds, it took from the start until the first byte is received by libcurl.
This includes curl.INFOPRETRANSFERTIME and also the time the server needs to calculate the result.
Used as parameter for curlobj.getinfo
- #number curl.INFO_TOTAL_TIME
-
The total time in seconds for the previous transfer, including name resolving, TCP connect etc.
Used as parameter for curlobj.getinfo
- #number curl.INTERFACE_FAILED
-
Its a selfdescribing error...
- #number curl.IOCMD_NOP
-
UNDOCUMENTED/NOTHING FOUND
- #number curl.IOCMD_RESTARTREAD
-
UNDOCUMENTED/NOTHING FOUND
- #number curl.IOE_FAILRESTART
-
UNDOCUMENTED/NOTHING FOUND
- #number curl.IOE_OK
-
UNDOCUMENTED/NOTHING FOUND
- #number curl.IOE_UNKNOWNCMD
-
UNDOCUMENTED/NOTHING FOUND
- #number curl.IPRESOLVE_V4
-
Resolve to IPv4 addresses.
Used for curl.OPT_IPRESOLVE
- #number curl.IPRESOLVE_V6
-
Resolve to IPv6 addresses.
Used for curl.OPT_IPRESOLVE
- #number curl.IPRESOLVE_WHATEVER
-
Default, resolves addresses to all IP versions that your system allows.
Used for curl.OPT_IPRESOLVE
- #number curl.LDAP_CANNOT_BIND
-
Its a selfdescribing error...
- #number curl.LDAP_INVALID_URL
-
Its a selfdescribing error...
- #number curl.LDAP_SEARCH_FAILED
-
Its a selfdescribing error...
- #number curl.LIBRARY_NOT_FOUND
-
Its a selfdescribing error...
- #number curl.LOGIN_DENIED
-
Its a selfdescribing error...
- #number curl.MALFORMAT_USER
-
Its a selfdescribing error...
- #number curl.NAMELENGTH
-
UNDOCUMENTED/NOTHING FOUND
- #number curl.NETRC_IGNORED
-
The library will ignore the file and use only the information in the URL.
This is the default.
Used for curl.OPT_NETRC
- #number curl.NETRC_OPTIONAL
-
The use of your ~/.netrc file is optional, and information in the URL is to be preferred.
The file will be scanned for the host and user name (to find the password only) or for the host only, to find the first user name and password after that machine, which ever information is not specified in the URL.
Undefined values of the option will have this effect.
Used for curl.OPT_NETRC
- #number curl.NETRC_REQUIRED
-
This value tells the library that use of the file is required, to ignore the information in the curl.OPT_URL, and to search the file for the host only.
Used for curl.OPT_NETRC
- #number curl.OBSOLETE
-
UNDOCUMENTED/NOTHING FOUND
- #number curl.OBSOLETE2
-
UNDOCUMENTED/NOTHING FOUND
- #number curl.OPERATION_TIMEOUTED
-
Its a selfdescribing error...
- #number curl.OPT_AUTOREFERER
-
Pass a #boolean set to true to enable this.
When enabled, libcurl will automatically set the Referer: field in requests where it follows a Location: redirect.
needs: #boolean
- #number curl.OPT_BUFFERSIZE
-
Pass a #number specifying your preferred size (in bytes) for the receive buffer in libcurl.
The main point of this would be that the write callback gets called more often and with smaller chunks. This is just treated as a request, not an order. You cannot be guaranteed to actually get the given size. (Added in 7.10)
needs: #number
- #number curl.OPT_CAINFO
-
Pass a #string naming a file holding one or more certificates to verify the peer with.
This makes sense only when used in combination with the curl.OPTSSLVERIFYPEER option. If curl.OPTSSLVERIFYPEER is zero, curl.OPT_CAINFO need not even indicate an accessible file.
This option is by default set to the system path where libcurl's cacert bundle is assumed to be stored, as established at build time.
If curl is built against the NSS SSL library, the NSS PEM PKCS#11 module (libnsspem.so) needs to be available for this option to work properly.
needs: #string
- #number curl.OPT_CAPATH
-
Pass a #string naming a directory holding multiple CA certificates to verify the peer with.
If libcurl is built against OpenSSL, the certificate directory must be prepared using the openssl c_rehash utility. This makes sense only when used in combination with the curl.OPTSSLVERIFYPEER option. If curl.OPTSSLVERIFYPEER is zero, curl.OPT_CAPATH need not even indicate an accessible path. The curl.OPT_CAPATH function apparently does not work in Windows due to some limitation in openssl. This option is OpenSSL-specific and does nothing if libcurl is built to use GnuTLS. NSS-powered libcurl provides the option only for backward compatibility.
needs: #string
- #number curl.OPT_CLOSEPOLICY
-
(Obsolete) This option does nothing.
needs: #number
- #number curl.OPT_CONNECTTIMEOUT
-
The #number should contain the maximum time in seconds that you allow the connection to the server to take.
This only limits the connection phase, once it has connected, this option is of no more use. Set to zero to switch to the default built-in connection timeout - 300 seconds. See also the curl.OPT_TIMEOUT option.
In unix-like systems, this might cause signals to be used unless curl.OPT_NOSIGNAL is set.
needs: #number
- #number curl.OPT_COOKIE
-
It will be used to set a cookie in the http request.
The format of the string should be NAME=CONTENTS, where NAME is the cookie name and CONTENTS is what the cookie should contain.
If you need to set multiple cookies, you need to set them all using a single option and thus you need to concatenate them all in one single string. Set multiple cookies in one string like this: "name1=content1; name2=content2;" etc.
This option sets the cookie header explicitly in the outgoing request(s). If multiple requests are done due to authentication, followed redirections or similar, they will all get this cookie passed on.
Using this option multiple times will only make the latest string override the previous ones.
needs: #string
- #number curl.OPT_COOKIEFILE
-
The #string should contain the name of your file holding cookie data to read.
The cookie data may be in Netscape / Mozilla cookie data format or just regular HTTP-style headers dumped to a file.
Given an empty or non-existing file or by passing the empty string (""), this option will enable cookies for this curl handle, making it understand and parse received cookies and then use matching cookies in future requests.
If you use this option multiple times, you just add more files to read. Subsequent files will add more cookies.
needs: #string
- #number curl.OPT_COOKIEJAR
-
Pass a file name as #string.
This will make libcurl write all internally known cookies to the specified file when curlobj.close is called. If no cookies are known, no file will be created. Specify "-" to instead have the cookies written to stdout. Using this option also enables cookies for this session, so if you for example follow a location it will make matching cookies get sent accordingly.
If the cookie jar file can't be created or written to (when the curlobj.close is called), libcurl will not and cannot report an error for this. Using curl.OPT_VERBOSE will get a warning to display, but that is the only visible feedback you get about this possibly lethal situation.
needs: #string
- #number curl.OPT_COOKIESESSION
-
Pass a #boolean set to true to mark this as a new cookie "session".
It will force libcurl to ignore all cookies it is about to load that are "session cookies" from the previous session. By default, libcurl always stores and loads all cookies, independent if they are session cookies or not. Session cookies are cookies without expiry date and they are meant to be alive and existing for this "session" only.
needs: #boolean
- #number curl.OPT_CRLF
-
If the value is set to true, libcurl converts Unix newlines to CRLF newlines on transfers.
Disable this option again by setting the value to false.
needs: #boolean
- #number curl.OPT_CUSTOMREQUEST
-
The #string can be used to specify the request instead of GET or HEAD when performing HTTP based requests, instead of LIST and NLST when performing FTP directory listings and instead of LIST and RETR when issuing POP3 based commands.
This is particularly useful, for example, for performing a HTTP DELETE request or a POP3 DELE command.
Please don't perform this at will, on HTTP based requests, by making sure your server supports the command you are sending first.
When you change the request method by setting curl.OPT_CUSTOMREQUEST to something, you don't actually change how libcurl behaves or acts in regards to the particular request method, it will only change the actual string sent in the request.
For example:
+ With the HTTP protocol when you tell libcurl to do a HEAD request, but then specify a GET though a custom request libcurl will still act as if it sent a HEAD. To switch to a proper HEAD use curl.OPT_NOBODY, to switch to a proper POST use curl.OPT_POST or curl.OPT_POSTFIELDS and to switch to a proper GET use curl.OPT_HTTPGET.
+ With the POP3 protocol when you tell libcurl to use a custom request it will behave like a LIST or RETR command was sent where it expects data to be returned by the server. As such curl.OPT_NOBODY should be used when specifying commands such as DELE and NOOP for example.
Restore to the internal default by setting this to #nil.
Many people have wrongly used this option to replace the entire request with their own, including multiple headers and POST contents. While that might work in many cases, it will cause libcurl to send invalid requests and it could possibly confuse the remote server badly. Use curl.OPT_POST and curl.OPT_POSTFIELDS to set POST data. Use curl.OPT_HTTPHEADER to replace or extend the set of headers sent by libcurl. Use curl.OPTHTTPVERSION to change HTTP version.
(Support for POP3 added in 7.26.0)
needs: #string
- #number curl.OPT_DNS_CACHE_TIMEOUT
-
This sets the timeout in seconds.
Name resolves will be kept in memory for this #number of seconds. Set to zero to completely disable caching, or set to -1 to make the cached entries remain forever. By default, libcurl caches this info for 60 seconds.
The name resolve functions of various libc implementations don't re-read name server information unless explicitly told so. This may cause libcurl to keep using the older server even if DHCP has updated the server info, and this may look like a DNS cache issue to the casual libcurl-app user.
needs: #number
- #number curl.OPT_DNS_USE_GLOBAL_CACHE
-
If the value is true, it tells curl to use a global DNS cache that will survive between easy handle creations and deletions.
This is not thread-safe and this will use a global variable.
WARNING: This option is considered obsolete. Stop using it. Switch over to using the share interface instead! (Not implemented in luacurl? Maybe as OPTDNSUSEGLOBALCACHE?)
needs: #boolean
- #number curl.OPT_EGDSOCKET
-
Pass a path name to the Entropy Gathering Daemon socket.
It will be used to seed the random engine for SSL.
needs: #string
- #number curl.OPT_ENCODING
-
_It has got an update...
I cannot say which number means which string!_ Sets the contents of the Accept-Encoding: header sent in a HTTP request, and enables decoding of a response when a Content-Encoding: header is received. Three encodings are supported:
+ identity : which does nothing
+ deflate : which requests the server to compress its response using the zlib algorithm
+ gzip which requests the gzip algorithm
If a zero-length string is set, then an Accept-Encoding: header containing all supported encodings is sent.
This is a request, not an order; the server may or may not do it. This option must be set (to any non-#nil value) or else any unsolicited encoding done by the server is ignored. (perhaps not in Lua available: See the special file lib/README.encoding for details.)
needs: #string
- #number curl.OPT_FAILONERROR
-
A parameter set to true tells the library to fail silently if the HTTP code returned is equal to or larger than 400.
The default action would be to return the page normally, ignoring that code.
This method is not fail-safe and there are occasions where non-successful response codes will slip through, especially when authentication is involved (response codes 401 and 407).
You might get some amounts of headers transferred before this situation is detected, like when a "100-continue" is received as a response to a POST/PUT and a 401 or 407 is received immediately afterwards.
needs: #boolean
- #number curl.OPT_FILETIME
-
If the #boolean is true, libcurl will attempt to get the modification date of the remote document in this operation.
This requires that the remote server sends the time or replies to a time querying command. The curl.getinfo function with the curl.INFO_FILETIME argument can be used after a transfer to extract the received time (if any).
needs: #boolean
- #number curl.OPT_FOLLOWLOCATION
-
A #boolean set to true tells the library to follow any Location: header that the server sends as part of a HTTP header.
This means that the library will re-send the same request on the new location and follow new Location: headers all the way until no more such headers are returned. curl.OPT_MAXREDIRS can be used to limit the number of redirects libcurl will follow.
Since 7.19.4, libcurl can limit what protocols it will automatically follow.
needs: #boolean
- #number curl.OPT_FORBID_REUSE
-
Set to ture to make the next transfer explicitly close the connection when done.
Normally, libcurl keeps all connections alive when done with one transfer in case a succeeding one follows that can re-use them. This option should be used with caution and only if you understand what it does.
Set to false to have libcurl keep the connection open for possible later re-use (default behavior).
needs: #boolean
- #number curl.OPT_FRESH_CONNECT
-
Set to true to make the next transfer use a new (fresh) connection by force.
If the connection cache is full before this connection, one of the existing connections will be closed as according to the selected or default policy. This option should be used with caution and only if you understand what it does.
Set this to false to have libcurl attempt re-using an existing connection (default behavior).
needs: #boolean
- #number curl.OPT_FTPAPPEND
-
A parameter set to true tells the library to append to the remote file instead of overwrite it.
This is only useful when uploading to an FTP site.
needs: #boolean
- #number curl.OPT_FTPLISTONLY
-
A parameter set to true tells the library to just list the names of files in a directory, instead of doing a full directory listing that would include file sizes, dates etc.
This works for FTP and SFTP URLs.
This causes an FTP NLST command to be sent on an FTP server. Beware that some FTP servers list only files in their response to NLST; they might not include subdirectories and symbolic links.
Setting this option to true also implies a directory listing even if the URL doesn't end with a slash, which otherwise is necessary.
needs: #boolean
- #number curl.OPT_FTPPORT
-
The #string will be used to get the IP address to use for the FTP PORT instruction.
The PORT instruction tells the remote server to connect to our specified IP address. The string may be a plain IP address, a host name, a network interface name (under Unix) or just a '-' symbol to let the library use your system's default IP address. Default FTP operations are passive, and thus won't use PORT.
The address can be followed by a ':' to specify a port, optionally followed by a '-' to specify a port range. If the port specified is 0, the operating system will pick a free port. If a range is provided and all ports in the range are not available, libcurl will report curl.FTPPORTFAILED for the handle. Invalid port/range settings are ignored. IPv6 addresses followed by a port or portrange have to be in brackets. IPv6 addresses without port/range specifier can be in brackets. (added in 7.19.5)
Examples with specified ports:
'eth0:0'
'<IP_ADDRESS>:32000-33000'
'curl.se:32123'
'[::1]:1234-4567''
You disable PORT again and go back to using the passive version by setting this option to #nil.
needs: #string
- #number curl.OPT_FTPSSLAUTH
-
Pass a #number using one of the values from below, to alter how libcurl issues "AUTH TLS" or "AUTH SSL" when FTP over SSL is activated .
(Added in 7.12.2)
Values:
+ curl.FTPAUTH_DEFAULT : Allow libcurl to decide.
+ curl.FTPAUTH_SSL : Try "AUTH SSL" first, and only if that fails try "AUTH TLS".
+ curl.FTPAUTH_TLS : Try "AUTH TLS" first, and only if that fails try "AUTH SSL".
needs: #number
- #number curl.OPT_FTP_ACCOUNT
-
When an FTP server asks for "account data" after user name and password has been provided, this data is sent off using the ACCT command.
(Added in 7.13.0)
needs: #string
- #number curl.OPT_FTP_CREATE_MISSING_DIRS
-
If the value is true, curl will attempt to create any remote directory that it fails to CWD into.
CWD is the command that changes working directory. (Added in 7.10.7)
This setting also applies to SFTP-connections. curl will attempt to create the remote directory if it can't obtain a handle to the target-location. The creation will fail if a file of the same name as the directory to create already exists or lack of permissions prevents creation. (Added in 7.16.3)
needs: #boolean
- #number curl.OPT_FTP_RESPONSE_TIMEOUT
-
Causes curl to set a timeout period (in seconds) on the amount of time that the server is allowed to take in order to generate a response message for a command before the session is considered hung.
While curl is waiting for a response, this value overrides curl.OPT_TIMEOUT. It is recommended that if used in conjunction with curl.OPT_TIMEOUT, you set curl.OPTFTPRESPONSE_TIMEOUT to a value smaller than curl.OPT_TIMEOUT. (Added in 7.10.8)
needs: #number
- #number curl.OPT_FTP_SSL
-
Pass a #number using one of the values from below, to make libcurl use your desired level of SSL for the transfer.
(Added in 7.11.0)
This is for enabling SSL/TLS when you use FTP, SMTP, POP3, IMAP etc.
+ curl.FTPSSL_NONE : Don't attempt to use SSL.
+ curl.FTPSSL_TRY : Try using SSL, proceed as normal otherwise.
+ curl.FTPSSL_CONTROL : Require SSL for the control connection or fail with CURLEUSESSL_FAILED.
+ curl.FTPSSL_ALL : Require SSL for all communication or fail with CURLEUSESSL_FAILED.
needs: #number
- #number curl.OPT_FTP_USE_EPRT
-
If the value is true, it tells curl to use the EPRT (and LPRT) command when doing active FTP downloads (which is enabled by curl.OPT_FTPPORT).
Using EPRT means that it will first attempt to use EPRT and then LPRT before using PORT, but if you pass zero to this option, it will not try using EPRT or LPRT, only plain PORT. (Added in 7.10.5)
If the server is an IPv6 host, this option will have no effect as of 7.12.3.
needs: #boolean
- #number curl.OPT_FTP_USE_EPSV
-
If the value is true, it tells curl to use the EPSV command when doing passive FTP downloads (which it always does by default).
Using EPSV means that it will first attempt to use EPSV before using PASV, but if you pass zero to this option, it will not try using EPSV, only plain PASV.
If the server is an IPv6 host, this option will have no effect as of 7.12.3.
needs: #boolean
- #number curl.OPT_HEADER
-
A parameter set to true tells the library to include the header in the body output.
This is only relevant for protocols that actually have headers preceding
needs: #boolean
default: false
- #number curl.OPT_HEADERDATA
-
Userparam of curl.OPT_HEADERFUNCTION
needs: userparam
- #number curl.OPT_HEADERFUNCTION
-
This function gets called by libcurl as soon as it has received header data.
The header callback will be called once for each header and only complete header lines are passed on to the callback. Parsing headers is very easy using this. The size of the data pointed to by ptr is size multiplied with nmemb. Do not assume that the header line is zero terminated! The pointer named userparam is the one you set with the curl.OPT_HEADERDATA option. The callback function must return the #number of bytes actually taken care of. If that amount differs from the amount passed to your function, it'll signal an error to the library. This will abort the transfer and return curl.WRITE_ERROR.
It's important to note that the callback will be invoked for the headers of all responses received after initiating a request and not just the final response. This includes all responses which occur during authentication negotiation. If you need to operate on only the headers from the final response, you will need to collect headers in the callback yourself and use HTTP status lines, for example, to delimit response boundaries.
When a server sends a chunked encoded transfer, it may contain a trailer. That trailer is identical to a HTTP header and if such a trailer is received it is passed to the application using this callback as well. There are several ways to detect it being a trailer and not an ordinary header: 1) it comes after the response-body. 2) it comes after the final header line (CR LF) 3) a Trailer: header among the regular response-headers mention what header(s) to expect in the trailer.
For non-HTTP protocols like FTP, POP3, IMAP and SMTP this function will get called with the server responses to the commands that libcurl sends.
returns: #number
- #number curl.OPT_HTTP200ALIASES
-
List of aliases to be treated as valid HTTP 200 responses.
Some servers respond with a custom header response line. For example, IceCast servers respond with "ICY 200 OK". By including this string in your list of aliases, the response will be treated as a valid HTTP header line such as "HTTP/1.0 200 OK". (Added in 7.10.3)
The alias itself is not parsed for any version strings. Before libcurl 7.16.3, Libcurl used the value set by option curl.OPTHTTPVERSION, but starting with 7.16.3 the protocol is assumed to match HTTP 1.0 when an alias matched.
needs: #string, ..., #string
- #number curl.OPT_HTTPAUTH
-
Pass a long as parameter, which is set to a bitmask, to tell libcurl which authentication method(s) you want it to use.
The available bits are listed below. If more than one bit is set, libcurl will first query the site to see which authentication methods it supports and then pick the best one you allow it to use. For some methods, this will induce an extra network round-trip. Set the actual name and password with the curl.OPT_USERPWD option (or with the CURLOPTUSERNAME and the CURLOPTPASSWORD options : NOT IMPLEMENTED??). (Added in 7.10.6)
Pass a #number, set to one of the values described below.
+ curl.AUTH_BASIC
+ curl.AUTH_DIGEST
+ curl.AUTH_GSSNEGOTIATE
+ curl.AUTH_NTLM
+ curl.AUTH_ANY
+ curl.AUTH_ANYSAFE
needs: #number
- #number curl.OPT_HTTPGET
-
If the #boolean is true, this forces the HTTP request to get back to GET.
Usable if a POST, HEAD, PUT, or a custom request has been used previously using the same curl handle.
When setting curl.OPT_HTTPGET to true, it will automatically set curl.OPT_NOBODY to false and curl.OPT_UPLOAD to false.
needs: #boolean
- #number curl.OPT_HTTPHEADER
-
HTTP headers to pass to the server in your HTTP request.
If you add a header with no content as in 'Accept:' (no data on the right side of the colon), the internally used header will get disabled. Thus, using this option you can add new headers, replace internal headers and remove internal headers. To add a header with no content (nothing to the right side of the colon), use the form 'MyHeader;' (note the ending semicolon).
The headers included in the list must not be CRLF-terminated, because curl adds CRLF after each header item. Failure to comply with this will result in strange bugs because the server will most likely ignore part of the headers you specified.
The first line in a request (containing the method, usually a GET or POST) is not a header and cannot be replaced using this option. Only the lines following the request-line are headers. Adding this method line in this list of headers will only cause your request to send an invalid header.
Pass a #nil to this to reset back to no custom headers.
The most commonly replaced headers have "shortcuts" in the options curl.OPT_COOKIE, curl.OPT_USERAGENT and curl.OPT_REFERER.
needs: #string, ..., #string
- #number curl.OPT_HTTPPOST
-
Tells libcurl you want a multipart/formdata HTTP POST to be made and you instruct what data to pass on to the server.
Pass a pointer to a linked list of curl_httppost structs as parameter. The data in this list must remain intact until you close this curl handle again with curlobj.close.
Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header. You can disable this header with curl.OPT_HTTPHEADER as usual.
When setting curl.OPT_HTTPPOST, it will automatically set curl.OPT_NOBODY to false (since 7.14.1).
needs: #string, ..., #string
- #number curl.OPT_HTTPPROXYTUNNEL
-
Set the parameter to true to make the library tunnel all operations through a given HTTP proxy.
There is a big difference between using a proxy and to tunnel through it. If you don't know what this means, you probably don't want this tunneling option.
needs: #boolean
- #number curl.OPT_HTTP_VERSION
-
Pass a #number, set to one of the values described below.
They force libcurl to use the specific HTTP versions. This is not sensible to do unless you have a good reason.
Values: + curl.HTTPVERSIONNONE : We don't care about what version the library uses. libcurl will use whatever it thinks fit.
+ curl.HTTP_VERSION10 : Enforce HTTP 1.0 requests.
+ curl.HTTP_VERSION11 : Enforce HTTP 1.1 requests.
needs: #number
- #number curl.OPT_INFILESIZE
-
When uploading a file to a remote site, this option should be used to tell libcurl what the expected size of the infile is.
See also curl.OPTINFILESIZELARGE.
For uploading using SCP, this option or curl.OPTINFILESIZELARGE is mandatory.
When sending emails using SMTP, this command can be used to specify the optional SIZE parameter for the MAIL FROM command. (Added in 7.23.0)
This option does not limit how much data libcurl will actually send, as that is controlled entirely by what the read callback returns.
needs: #number
- #number curl.OPT_INFILESIZE_LARGE
-
When uploading a file to a remote site, this option should be used to tell libcurl what the expected size of the infile is.
For uploading using SCP, this option or curl.OPT_INFILESIZE is mandatory.
This option does not limit how much data libcurl will actually send, as that is controlled entirely by what the read callback returns.
needs: #number
- #number curl.OPT_INTERFACE
-
This sets the interface name to use as outgoing network interface.
The name can be an interface name, an IP address, or a host name.
Starting with 7.24.0: If the parameter starts with "if!" then it is treated as only as interface name and no attempt will ever be named to do treat it as an IP address or to do name resolution on it. If the parameter starts with "host!" it is treated as either an IP address or a hostname. Hostnames are resolved synchronously. Using the if! format is highly recommended when using the multi interfaces to avoid allowing the code to block. If "if!" is specified but the parameter does not match an existing interface, curl.INTERFACE_FAILED is returned.
needs: #string
- #number curl.OPT_IOCTLDATA
-
Pass a pointer that will be untouched by libcurl and passed as the 3rd argument in the ioctl callback set with CURLOPT_IOCTLFUNCTION.
Userparam of curl.OPT_IOCTLDATA
needs: userparam
default: #nil (Option added in 7.12.3).
- #number curl.OPT_IOCTLFUNCTION
-
This function gets called by libcurl when something special I/O-related needs to be done that the library can't do by itself.
For now, rewinding the read data stream is the only action it can request. The rewinding of the read data stream may be necessary when doing a HTTP PUT or POST with a multi-pass authentication method.
needs: function(userparam, command)
returns: #number
default: #nil (Option added in 7.12.3).
- #number curl.OPT_IPRESOLVE
-
Allows an application to select what kind of IP addresses to use when resolving host names.
This is only interesting when using host names that resolve addresses using more than one version of IP.
The allowed values are:
curl.IPRESOLVE_WHATEVER : Default, resolves addresses to all IP versions that your system allows.
curl.CURLIPRESOLVEV4 : Resolve to IPv4 addresses.
curl.IPRESOLVE_V6 : Resolve to IPv6 addresses.
needs: #number
- #number curl.OPT_KRB4LEVEL
-
_It has got an update...
I cannot say which number means which string!_ Set the kerberos security level for FTP; this also enables kerberos awareness. This is a string (the doc says "NO!"), 'clear', 'safe', 'confidential' or 'private'. If the string is set but doesn't match one of these, 'private' will be used. Set the string to #nil to disable kerberos support for FTP.
needs: #string
- #number curl.OPT_LOW_SPEED_LIMIT
-
The #number contains the transfer speed in bytes per second that the transfer should be below during curl.OPTLOWSPEED_TIME seconds for the library to consider it too slow and abort.
needs: #number
- #number curl.OPT_LOW_SPEED_TIME
-
The #number contains the time in seconds that the transfer should be below the curl.OPTLOWSPEED_LIMIT for the library to consider it too slow and abort.
needs: #number
- #number curl.OPT_MAXCONNECTS
-
The set number will be the persistent connection cache size.
The set amount will be the maximum amount of simultaneously open connections that libcurl may cache in this easy handle. Default is 5, and there isn't much point in changing this value unless you are perfectly aware of how this works and changes libcurl's behaviour. This concerns connections using any of the protocols that support persistent connections.
When reaching the maximum limit, curl closes the oldest one in the cache to prevent increasing the number of open connections.
If you already have performed transfers with this curl handle, setting a smaller curl.OPT_MAXCONNECTS than before may cause open connections to get closed unnecessarily.
needs: #number
- #number curl.OPT_MAXFILESIZE
-
This allows you to specify the maximum size (in bytes) of a file to download.
If the file requested is larger than this value, the transfer will not start and curl.FILESIZE_EXCEEDED will be returned.
The file size is not always known prior to download, and for such files this option has no effect even if the file transfer ends up being larger than this given limit. This concerns both FTP and HTTP transfers.
needs: #number
- #number curl.OPT_MAXFILESIZE_LARGE
-
This allows you to specify the maximum size (in bytes) of a file to download.
If the file requested is larger than this value, the transfer will not start and curl.FILESIZE_EXCEEDED will be returned. (Added in 7.11.0)
The file size is not always known prior to download, and for such files this option has no effect even if the file transfer ends up being larger than this given limit. This concerns both FTP and HTTP transfers.
needs: #number
- #number curl.OPT_MAXREDIRS
-
Pass a #number.
The set #number will be the redirection limit. If that many redirections have been followed, the next redirect will cause an error (curl.TOOMANYREDIRECTS). This option only makes sense if the curl.OPT_FOLLOWLOCATION is used at the same time.
Added in 7.15.1: Setting the limit to 0 will make libcurl refuse any redirect. Set it to -1 for an infinite number of redirects (which is the default)
needs: #number
default: -1
- #number curl.OPT_NETRC
-
This parameter controls the preference of libcurl between using user names and passwords from your ~/.netrc file, relative to user names and passwords in the URL supplied with curl.OPT_URL.
libcurl uses a user name (and supplied or prompted password) supplied with curl.OPT_USERPWD in preference to any of the options controlled by this parameter.
Pass a #number, set to one of the values described below.
+ curl.NETRC_OPTIONAL
+ curl.NETRC_IGNORED
+ curl.NETRC_REQUIRED
needs: #number
default: curl.NETRC_IGNORED
- #number curl.OPT_NETRC_FILE
-
The full path name to the file you want libcurl to use as .netrc file.
If this option is omitted, and curl.OPT_NETRC is set, libcurl will attempt to find a /.netrc file in the current user's home directory. (Added in 7.10.9)
needs: #string
- #number curl.OPT_NOBODY
-
A #boolean set to true tells the library to not include the body-part in the output.
This is only relevant for protocols that have separate header and body parts. On HTTP(S) servers, this will make libcurl do a HEAD request.
To change request to GET, you should use curl.OPT_HTTPGET. Change request to POST with curl.OPT_POST etc.
needs: #boolean
- #number curl.OPT_NOPROGRESS
-
If set to true, it tells the library to shut off the progress meter completely.
It will also prevent the curl.OPT_PROGRESSFUNCTION from getting called.. Future versions of libcurl are likely to not have any built-in progress meter at all.
needs: #boolean
default: true.
- #number curl.OPT_NOSIGNAL
-
If it is true, libcurl will not use any functions that install signal handlers or any functions that cause signals to be sent to the process.
This option is mainly here to allow multi-threaded unix applications to still set/use all timeout options etc, without risking getting signals.
If this option is set and libcurl has been built with the standard name resolver, timeouts will not occur while the name resolve takes place. Consider building libcurl with c-ares support to enable asynchronous DNS lookups, which enables nice timeouts for name resolves without signals.
Setting curl.OPT_NOSIGNAL to 1 makes libcurl NOT ask the system to ignore SIGPIPE signals, which otherwise are sent by the system when trying to send data to a socket which is closed in the other end. libcurl makes an effort to never cause such SIGPIPEs to trigger, but some operating systems have no way to avoid them and even on those that have there are some corner cases when they may still happen, contrary to our desire. In addition, using CURLAUTHNTLMWB authentication could cause a SIGCHLD signal to be raised.
needs: #boolean
default: false (Added in 7.10)
- #number curl.OPT_PORT
-
Pass a #number specifying what remote port #number to connect to, instead of the one specified in the curl.OPT_URL or the default port for the used protocol.
needs: #number
- #number curl.OPT_POST
-
A #boolean set to true tells the library to do a regular HTTP post.
This will also make the library use a "Content-Type: application/x-www-form-urlencoded" header. (This is by far the most commonly used POST method).
Use curl.OPT_POSTFIELDS option to specify what data to post and curl.OPT_POSTFIELDSIZE or curl.OPTPOSTFIELDSIZELARGE to set the data size.
Optionally, you can provide data to POST using the curl.OPT_READFUNCTION and curl.OPT_READDATA options but then you must make sure to not set curl.OPT_POSTFIELDS to anything but #nil. When providing data with a callback, you must transmit it using chunked transfer-encoding or you must set the size of the data with the curl.OPT_POSTFIELDSIZE or curl.OPTPOSTFIELDSIZELARGE option. To enable chunked encoding, you simply pass in the appropriate Transfer-Encoding header.
You can override the default POST Content-Type: header by setting your own with curl.OPT_HTTPHEADER.
Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header. You can disable this header with CURLOPT_HTTPHEADER as usual.
If you use POST to a HTTP 1.1 server, you can send data without knowing the size before starting the POST if you use chunked encoding. You enable this by adding a header like "Transfer-Encoding: chunked" with curl.OPT_HTTPHEADER. With HTTP 1.0 or without chunked transfer, you must specify the size in the request.
When setting curl.OPT_POST to true, it will automatically set curl.OPT_NOBODY to false (since 7.14.1).
If you issue a POST request and then want to make a HEAD or GET using the same re-used handle, you must explicitly set the new request type using curl.OPT_NOBODY or curl.OPT_HTTPGET or similar.
needs: #boolean
- #number curl.OPT_POSTFIELDS
-
The full data to post in a HTTP POST operation.
You must make sure that the data is formatted the way you want the server to receive it. libcurl will not convert or encode it for you. Most web servers will assume this data to be url-encoded.
The data #string are NOT copied by the library: as a consequence, they must be preserved by the calling application until the transfer finishes.
This POST is a normal application/x-www-form-urlencoded kind (and libcurl will set that Content-Type by default when this option is used), which is the most commonly used one by HTML forms. See also the curl.OPT_POST. Using curl.OPT_POSTFIELDS implies curl.OPT_POST.
If you want to do a zero-byte POST, you need to set curl.OPT_POSTFIELDSIZE explicitly to zero, as simply setting curl.OPT_POSTFIELDS to #nil or "" just effectively disables the sending of the specified string. libcurl will instead assume that you'll send the POST data using the read callback!
Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header. You can disable this header with curl.OPT_HTTPHEADER as usual.
To make multipart/formdata posts (aka RFC 2388 -posts), check out the curl.OPT_HTTPPOST option.
needs: #string
- #number curl.OPT_POSTFIELDSIZE
-
If you want to post data to the server without letting libcurl do a strlen() (C-function, similar to string.len() in Lua) to measure the data size, this option must be used.
When this option is used you can post fully binary data, which otherwise is likely to fail. If this size is set to -1, the library will use strlen() to get the size.
needs: #number
- #number curl.OPT_POSTFIELDSIZE_LARGE
-
Use this to set the size of the curl.OPT_POSTFIELDS data to prevent libcurl from doing strlen() (C-function, similar to string.len() in Lua) on the data to figure out the size.
This is the large file version of the curl.OPT_POSTFIELDSIZE option. (Added in 7.11.1)
needs: #number
- #number curl.OPT_POSTQUOTE
-
Pass a list of FTP or SFTP commands to pass to the server after your FTP transfer request.
The commands will only be run if no error occurred. The linked list should be a fully valid list of struct curl_slist structs properly filled in as described for curl.OPT_QUOTE. Disable this operation again by setting a #nil to this option.
needs: #string, ..., #string
- #number curl.OPT_PREQUOTE
-
Pass a list of FTP commands to pass to the server after the transfer type is set.
The linked list should be a fully valid list of properly filled in as described below. Disable this operation again by setting a #nil to this option. Before version 7.16.0, if you also set curl.OPT_NOBODY to true, this option didn't work.
The valid FTP commands are:
+ chgrp
+ chmod
+ chown
+ ln
+ mkdir
+ pwd
+ rename
+ rm
+ rmdir
+ symlink
needs: #string, ..., #string
- #number curl.OPT_PROGRESSDATA
-
userparam of curl.OPT_PROGRESSFUNCTION
needs: userparam
- #number curl.OPT_PROGRESSFUNCTION
-
This function gets called by libcurl instead of its internal equivalent with a frequent interval.
While data is being transferred it will be called very frequently, and during slow periods like when nothing is being transferred it can slow down to about one call per second.
userparam is the pointer set with curl.OPT_PROGRESSDATA, it is not actually used by libcurl but is only passed along from the application to the callback.
The callback gets told how much data libcurl will transfer and has transferred, in #number of bytes. dltotal is the total #number of bytes libcurl expects to download in this transfer. dlnow is the #number of bytes downloaded so far. ultotal is the total #number of bytes libcurl expects to upload in this transfer. ulnow is the #number of bytes uploaded so far.
Unknown/unused argument values passed to the callback will be set to zero (like if you only download data, the upload size will remain 0). Many times the callback will be called one or more times first, before it knows the data sizes so a program must be made to handle that.
CURLOPT_NOPROGRESS must be set to 0 to make this function actually get called.
needs: function(userparam, dltotal, dlnow, uptotal, upnow)
returns: #number
- #number curl.OPT_PROXY
-
IP-address of the proxy.
The proxy #string may be prefixed with [protocol]:// since any such prefix will be ignored. The proxy's port #number may optionally be specified with the separate option. If not specified, libcurl will default to using port 1080 for proxies. curl.OPT_PROXYPORT.
When you tell the library to use a HTTP proxy, libcurl will transparently convert operations to HTTP even if you specify an FTP URL etc. This may have an impact on what other features of the library you can use, such as curl.OPT_QUOTE and similar FTP specifics that don't work unless you tunnel through the HTTP proxy. Such tunneling is activated with curl.OPT_HTTPPROXYTUNNEL.
needs: #string
- #number curl.OPT_PROXYAUTH
-
Pass a #number as parameter, which is set to a bitmask, to tell libcurl which authentication method(s) you want it to use for your proxy authentication.
If more than one bit is set, libcurl will first query the site to see what authentication methods it supports and then pick the best one you allow it to use. For some methods, this will induce an extra network round-trip. Set the actual name and password with the curl.OPT_PROXYUSERPWD option. The bitmask can be constructed by or'ing together the bits listed above for the curl.OPT_HTTPAUTH option. As of this writing, only Basic, Digest and NTLM work. (Added in 7.10.7)
needs: #number
- #number curl.OPT_PROXYPORT
-
Set the proxy port to connect to unless it is specified in the proxy #string curl.OPT_PROXY.
needs: #number
- #number curl.OPT_PROXYTYPE
-
Available options for this are:
+ curl.PROXY_HTTP
+ curl.PROXY_HTTP10 (added in 7.19.4)
+ curl.PROXY_SOCKS4 (added in 7.10)
+ curl.PROXY_SOCKS5
+ curl.PROXY_SOCKS4A (added in 7.18.0)
+ curl.PROXYSOCKS5HOSTNAME (added in 7.18.0)
The HTTP type is default.(Added in 7.10) If you set curl.OPT_PROXYTYPE to curl.PROXY_HTTP10, it will only affect how libcurl speaks to a proxy when CONNECT is used. The HTTP version used for "regular" HTTP requests is instead controlled with curl.OPTHTTPVERSION.
needs: #number
default: curl.HTTP (Added in 7.10)
- #number curl.OPT_PROXYUSERPWD
-
The #string should be [user name]:[password] to use for the connection to the HTTP proxy.
Use curl.OPT_PROXYAUTH to specify the authentication method.
needs: #string
- #number curl.OPT_PUT
-
A #boolean set to true tells the library to use HTTP PUT to transfer data.
The data should be set with curl.OPT_READDATA and curl.OPT_INFILESIZE.
This option is deprecated and starting with version 7.12.1 you should instead use curl.OPT_UPLOAD.
needs: #boolean
- #number curl.OPT_QUOTE
-
Pass a list of FTP or SFTP commands to pass to the server prior to your FTP request.
This will be done before any other commands are issued (even before the CWD command for FTP).
The list should be a fully valid list of one of the values below.
Disable this operation again by setting a #nil to this option. When speaking to a FTP (or SFTP since 7.24.0) server, prefix the command with an asterisk (/) to make libcurl continue even if the command fails as by default libcurl will stop at first failure.
The set of valid FTP commands depends on the server (see RFC 959 for a list of mandatory commands).
The valid SFTP commands are:
+ chgrp
+ chmod
+ chown
+ ln
+ mkdir
+ pwd
+ rename
+ rm
+ rmdir
+ symlink
(see curl (1); I don't know what that means... I can't find it...) (SFTP support added in 7.16.3)
needs: #string, ..., #string
- #number curl.OPT_RANDOM_FILE
-
Pass a file name.
The file will be used to read from to seed the random engine for SSL. The more random the specified file is, the more secure the SSL connection will become.
needs: #string
- #number curl.OPT_RANGE
-
Pass a #string as parameter, which should contain the specified range you want.
It should be in the format "X-Y", where X or Y may be left out. HTTP transfers also support several intervals, separated with commas as in "X-Y,N-M". Using this kind of multiple intervals will cause the HTTP server to send the response document in pieces (using standard MIME separation techniques). For RTSP, the formatting of a range should follow RFC 2326 Section 12.29. For RTSP, byte ranges are not permitted. Instead, ranges should be given in npt, utc, or smpte formats.
Pass a #nil to this option to disable the use of ranges.
Ranges work on HTTP, FTP, FILE (since 7.18.0), and RTSP (since 7.20.0) transfers only.
needs: #string
- #number curl.OPT_READDATA
-
userparam to pass to the file read function.
If you use the curl.OPT_READFUNCTION if you set this option.
This option was also known by the older name curl.OPT_INFILE, the name curl.OPT_READDATA was introduced in 7.9.7.
needs: userparam
- #number curl.OPT_READFUNCTION
-
This function gets called by libcurl as soon as it needs to read data in order to send it to the peer.
Your function must return the actual #number of bytes that you stored in that memory area. Returning 0 will signal end-of-file to the library and cause it to stop the current transfer.
If you stop the current transfer by returning 0 "pre-maturely" (i.e before the server expected it, like when you've said you will upload N bytes and you upload less than N bytes), you may experience that the server "hangs" waiting for the rest of the data that won't come.
The read callback may return curl.READFUNC_ABORT to stop the current operation immediately.
Bugs: when doing TFTP uploads, you must return the exact amount of data that the callback wants, or it will be considered the final packet by the server end and the transfer will end there.
needs: function(userparam, size)
returns: #string
- #number curl.OPT_REFERER
-
It will be used to set the Referer: header in the http request sent to the remote server.
This can be used to fool servers or scripts. You can also set any custom header with curl.OPT_HTTPHEADER.
needs: #string
- #number curl.OPT_RESUME_FROM
-
The #number contains the offset in number of bytes that you want the transfer to start from.
Set this option to 0 to make the transfer start from the beginning (effectively disabling resume). For FTP, set this option to -1 to make the transfer start from the end of the target file (useful to continue an interrupted upload).
When doing uploads with FTP, the resume position is where in the local/source file libcurl should try to resume the upload from and it will then append the source file to the remote target file.
needs: #number
- #number curl.OPT_RESUME_FROM_LARGE
-
The #number contains the offset in number of bytes that you want the transfer to start from.
(Added in 7.11.0)
needs: #number
- #number curl.OPT_SOURCE_POSTQUOTE
-
I cannot find anything about this...
needs: #string, ..., #string
- #number curl.OPT_SOURCE_PREQUOTE
-
I cannot find anything about this...
needs: #string, ..., #string
- #number curl.OPT_SOURCE_QUOTE
-
I cannot find anything about this...
needs: #string, ..., #string
- #number curl.OPT_SOURCE_URL
-
I cannot find anything about this...
needs: #string
- #number curl.OPT_SOURCE_USERPWD
-
Login details #string for the connection.
The format of which is: [user name]:[password];[options].
When using NTLM, you can set the domain by prepending it to the user name and separating the domain and name with a forward (/) or backward slash (). Like this: "domain/user:password" or "domain\user:password". Some HTTP servers (on Windows) support this style even for Basic authentication.
When using HTTP and curl.OPT_FOLLOWLOCATION, libcurl might perform several requests to possibly different hosts. libcurl will only send this user and password information to hosts using the initial host name (unless curl.OPTUNRESTRICTEDAUTH is set), so if libcurl follows locations to other hosts it will not send the user and password to those. This is enforced to prevent accidental information leakage.
At present only IMAP, POP3 and SMTP support login options as part of the details #string. For more information about the login options please see RFC 2384 , RFC5092 and IETF draft draft-earhart-url-smtp-00.txt (Added in 7.31.0). Use curl.OPT_HTTPAUTH to specify the authentication method for HTTP based connections.
needs: #string
- #number curl.OPT_SSLCERT
-
The #string should be the file name of your certificate.
The default format is "PEM" and can be changed with curl.OPT_SSLCERTTYPE.
With NSS this can also be the nickname of the certificate you wish to authenticate with.
If you want to use a file from the current directory, please precede it with "./" prefix, in order to avoid confusion with a nickname.
(iOS and Mac OS X only) With Secure Transport, this string must match the name of a certificate that's in the system or user keychain. You should encode this string in UTF-8 format in case it contains non-ASCII characters. The private key corresponding to the certificate, and certificate chain (if any), must also be present in the keychain. (Added in 7.31.0)
needs: #string
- #number curl.OPT_SSLCERTTYPE
-
The #string should be the format of your certificate.
Supported formats are "PEM" and "DER". (Added in 7.9.3)
needs: #string
- #number curl.OPT_SSLENGINE
-
It will be used as the identifier for the crypto engine you want to use for your private key.
If the crypto device cannot be loaded, curl.SSLENGINENOTFOUND is returned.
needs: #string
- #number curl.OPT_SSLENGINE_DEFAULT
-
Sets the actual crypto engine as the default for (asymmetric) crypto operations.
If the crypto device cannot be set, curl.SSLENGINESETFAILED is returned.
Even though this option doesn't need any parameter, in some configurations curlobj.setopt might be defined as a macro taking exactly three arguments. Therefore, it's recommended to pass 1 as parameter to this option.
needs: #boolean
- #number curl.OPT_SSLKEY
-
The #string should be the file name of your private key.
The default format is "PEM" and can be changed with curl.OPT_SSLKEYTYPE.
(iOS and Mac OS X only) This option is ignored if curl was built against Secure Transport. Secure Transport expects the private key to be already present in the keychain containing the certificate.
needs: #string
- #number curl.OPT_SSLKEYPASSWD
-
It will be used as the password required to use the curl.OPT_SSLKEY or private key.
You never needed a pass phrase to load a certificate but you need one to load your private key.
needs: #string
- #number curl.OPT_SSLKEYTYPE
-
The #string should be the format of your private key.
Supported formats are "PEM", "DER" and "ENG".
The format "ENG" enables you to load the private key from a crypto engine. In this case curl.OPT_SSLKEY is used as an identifier passed to the engine. You have to set the crypto engine with curl.OPT_SSLENGINE. "DER" format key file currently does not work because of a bug in OpenSSL.
needs: #string
- #number curl.OPT_SSLVERSION
-
Pass a šnumber as parameter to control what version of SSL/TLS to attempt to use.
The available options are:
+ curl.SSLVERSION_DEFAULT : The default action. This will attempt to figure out the remote SSL protocol version, i.e. either SSLv3 or TLSv1 (but not SSLv2, which became disabled by default with 7.18.1).
+ curl.CURLSSLVERSIONTLSv1 : Force TLSv1
+ curl.CURLSSLVERSIONSSLv2 : Force SSLv2
+ curl.CURLSSLVERSIONSSLv3 : Force SSLv3
needs: #number
- #number curl.OPT_SSL_CIPHER_LIST
-
Pass a #string holding the list of ciphers to use for the SSL connection.
The list must be syntactically correct, it consists of one or more cipher strings separated by colons. Commas or spaces are also acceptable separators but colons are normally used, !, - and + can be used as operators.
For OpenSSL and GnuTLS valid examples of cipher lists include
+ 'RC4-SHA'
+ 'SHA1+DES'
+ 'TLSv1'
+ 'DEFAULT'
The default list is normally set when you compile OpenSSL. You'll find more details about cipher lists on this URL: http://www.openssl.org/docs/apps/ciphers.html
For NSS, valid examples of cipher lists include 'rsarc4128md5', 'rsaaes128sha', etc. With NSS you don't add/remove ciphers. If one uses this option then all known ciphers are disabled and only those passed in are enabled.
You'll find more details about the NSS cipher lists on this URL: http://git.fedorahosted.org/cgit/modnss.git/plain/docs/modnss.html#Directives
needs: #string
- #number curl.OPT_SSL_VERIFYHOST
-
This option determines whether libcurl verifies that the server cert is for the server it is known as.
When negotiating a SSL connection, the server sends a certificate indicating its identity.
+ When curl.OPTSSLVERIFYHOST is 2, that certificate must indicate that the server is the server to which you meant to connect, or the connection fails.
Curl considers the server the intended one when the Common Name field or a Subject Alternate Name field in the certificate matches the host name in the curl.OPT_URL to which you told Curl to connect.
+ When the value is 1, libcurl will return a failure.
It was previously (in 7.28.0 and earlier) a debug option of some sorts, but it is no longer supported due to frequently leading to programmer mistakes.
When the value is 0, the connection succeeds regardless of the names in the certificate.
This option controls checking the server's certificate's claimed identity. The server could be lying. To control lying, see curl.OPTSSLVERIFYPEER. If libcurl is built against NSS and curl.OPTSSLVERIFYPEER is false, curl.OPTSSLVERIFYHOST is ignored.
needs: #number
default: 2
- #number curl.OPT_SSL_VERIFYPEER
-
This option determines whether curl verifies the authenticity of the peer's certificate.
true means curl verifies; false means it doesn't.
When negotiating a SSL connection, the server sends a certificate indicating its identity. Curl verifies whether the certificate is authentic, i.e. that you can trust that the server is who the certificate says it is. This trust is based on a chain of digital signatures, rooted in certification authority (CA) certificates you supply. curl uses a default bundle of CA certificates (the path for that is determined at build time) and you can specify alternate certificates with the curl.OPT_CAINFO option or the curl.OPT_CAPATH option.
When curl.OPTSSLVERIFYPEER is true, and the verification fails to prove that the certificate is authentic, the connection fails. When the option is false, the peer certificate verification succeeds regardless.
Authenticating the certificate is not by itself very useful. You typically want to ensure that the server, as authentically identified by its certificate is the server you mean to be talking to. Use curl.OPTSSLVERIFYHOST to control that. The check that the host name in the certificate is valid for the host name you're connecting to is done independently of the curl.OPTSSLVERIFYPEER option.
needs: #boolean
default: true
- #number curl.OPT_TCP_NODELAY
-
Pass a #number specifying whether the curl.OPTTCPNODELAY option is to be set or cleared (true = set, false = clear).
This will have no effect after the connection has been established.
Setting this option will disable TCP's Nagle algorithm. The purpose of this algorithm is to try to minimize the #number of small packets on the network (where "small packets" means TCP segments less than the Maximum Segment Size (MSS) for the network).
Maximizing the amount of data sent per TCP segment is good because it amortizes the overhead of the send. However, in some cases (most notably telnet or rlogin) small segments may need to be sent without delay. This is less efficient than sending larger amounts of data at a time, and can contribute to congestion on the network if overdone.
needs: #boolean
default: false
- #number curl.OPT_TELNETOPTIONS
-
Provide a pointer to a list with variables to pass to the telnet negotiations.
The variables should be in the format
- #number curl.OPT_TIMECONDITION
-
This defines how the curl.OPT_TIMEVALUE time value is treated.
You can set this parameter to curl.TIMECOND_IFMODSINCE or curl.TIMECOND_IFUNMODSINCE. This feature applies to HTTP, FTP, RTSP, and FILE.
The last modification time of a file is not always known and in such instances this feature will have no effect even if the given time condition would not have been met.
needs: #number
- #number curl.OPT_TIMEOUT
-
Pass a #number as parameter containing the maximum time in seconds that you allow the libcurl transfer operation to take.
Normally, name lookups can take a considerable time and limiting operations to less than a few minutes risk aborting perfectly normal operations. This option will cause curl to use the SIGALRM to enable time-outing system calls.
In unix-like systems, this might cause signals to be used unless curl.OPT_NOSIGNAL is set.
Default timeout is 0 (zero) which means it never times out.
needs: #number
- #number curl.OPT_TIMEVALUE
-
This should be the time in seconds since 1 Jan 1970, and the time will be used in a condition as specified with curl.OPT_TIMECONDITION.
needs: #number
- #number curl.OPT_TRANSFERTEXT
-
A #boolean set to true tells the library to use ASCII mode for FTP transfers, instead of the default binary transfer.
For win32 systems it does not set the stdout to binary mode. This option can be usable when transferring text data between systems with different views on certain characters, such as newlines or similar.
libcurl does not do a complete ASCII conversion when doing ASCII transfers over FTP. This is a known limitation/flaw that nobody has rectified. libcurl simply sets the mode to ASCII and performs a standard transfer.
needs: #boolean
- #number curl.OPT_UNRESTRICTED_AUTH
-
A #boolean set to true tells the library it can continue to send authentication (user+password) when following locations, even when hostname changed.
This option is meaningful only when setting curl.OPT_FOLLOWLOCATION.
needs: #boolean
- #number curl.OPT_UPLOAD
-
A parameter set to 1 tells the library to prepare for an upload.
The curl.OPT_READDATA and curl.OPT_INFILESIZE or curl.OPTINFILESIZELARGE options are also interesting for uploads. If the protocol is HTTP, uploading means using the PUT request unless you tell libcurl otherwise.
Using PUT with HTTP 1.1 implies the use of a "Expect: 100-continue" header. You can disable this header with curl.OPT_HTTPHEADER as usual.
If you use PUT to a HTTP 1.1 server, you can upload data without knowing the size before starting the transfer if you use chunked encoding. You enable this by adding a header like "Transfer-Encoding: chunked" with curl.OPT_HTTPHEADER. With HTTP 1.0 or without chunked transfer, you must specify the size.
needs: #boolean
- #number curl.OPT_URL
-
The URL used to receive/send data.
needs: #string
- #number curl.OPT_USERAGENT
-
It will be used to set the User-Agent: header in the http request sent to the remote server.
This can be used to fool servers or scripts. You can also set any custom header with curl.OPT_HTTPHEADER.
needs: #string
- #number curl.OPT_USERPWD
-
needs: #string
- #number curl.OPT_VERBOSE
-
Set the parameter to true to get the library to display a lot of verbose information about its operations.
Very useful for libcurl and/or protocol debugging and understanding. The verbose information will be sent to stderr. You hardly ever want this set in production use, you will almost always want this when you debug/report problems.
needs: #boolean
default: false
- #number curl.OPT_WRITEDATA
-
userparam to pass to the file write function.
If you use the curl.OPT_WRITEFUNCTION option, this is the pointer you'll get as input.
NOTE: If you're using libcurl as a win32 DLL, you MUST use the curl.OPT_WRITEFUNCTION if you set this option or you will experience crashes.
This option is also known with the older name CURLOPTFILE, the name CURLOPTWRITEDATA was introduced in 7.9.7.
The written data (a table)
needs: userparam
- #number curl.OPT_WRITEFUNCTION
-
This function gets called by libcurl as soon as there is data received that needs to be saved.
Return the #number of bytes actually taken care of. If that amount differs from the amount passed to your function, it'll signal an error to the library. This will abort the transfer and return curl.WRITE_ERROR.
This function may be called with zero bytes data if the transferred file is empty.
Set this option to #nil to get the internal default function. The internal default function will write the data to the userparam given with curl.OPT_WRITEDATA.
Set the userdata argument with the curl.OPT_WRITEDATA option. The callback function will be passed as much data as possible in all invokes, but you cannot possibly make any assumptions. It may be one byte, it may be thousands.
needs: function(userparam, buffer)
returns: #number
- #number curl.OPT_WRITEINFO
-
I am not sure...
I can't do anything with it, but it says it sets write informations. It is given in the documentation, that it needs a string... but there is nochting more about it
needs: #string
- #number curl.OUT_OF_MEMORY
-
Its a selfdescribing error...
- #number curl.PARTIAL_FILE
-
Its a selfdescribing error...
- #number curl.PROXY_HTTP
-
HTTP-type proxy
Used for curl.OPT_PROXYTYPE
- #number curl.PROXY_SOCKS4
-
SOCKS4-type proxy
Used for curl.OPT_PROXYTYPE
- #number curl.PROXY_SOCKS5
-
SOCKS5-type proxy
Used for curl.OPT_PROXYTYPE
- #number curl.PTRCONTENTS
-
The actual data to send away.
libcurl will use the pointer and refer to the data in your application, so you must make sure it remains until curl no longer needs it. If the data isn't NUL-terminated, or if you'd like it to contain zero bytes, you must set its length with curl.CONTENTSLENGTH.
needs: #table
- #number curl.PTRNAME
-
The #string provides the pointer-name.
libcurl will use the pointer and refer to the data in your application, so you must make sure it remains until curl no longer needs it.
needs: #string
- #number curl.READFUNC_ABORT
-
Aborts the read-function.
I can't really say if its usefull in Lua, as Lua does not provide cross-thread used variables in threading...
- #number curl.READ_ERROR
-
Its a selfdescribing error...
- #number curl.SEND_ERROR
-
Its a selfdescribing error...
- #number curl.SEND_FAIL_REWIND
-
Its a selfdescribing error...
- #number curl.SHARE_IN_USE
-
Its a selfdescribing error...
- #number curl.SSLVERSION_DEFAULT
-
The default action.
This will attempt to figure out the remote SSL protocol version, i.e. either SSLv3 or TLSv1 (but not SSLv2, which became disabled by default with 7.18.1).
Used for curl.OPT_SSLVERSION
- #number curl.SSLVERSION_SSLv2
-
Force SSLv2
Used for curl.OPT_SSLVERSION
- #number curl.SSLVERSION_SSLv3
-
Force SSLv3
Used for curl.OPT_SSLVERSION
- #number curl.SSLVERSION_TLSv1
-
Force TLSv1
Used for curl.OPT_SSLVERSION
- #number curl.SSL_CACERT
-
Its a selfdescribing error...
- #number curl.SSL_CERTPROBLEM
-
Its a selfdescribing error...
- #number curl.SSL_CIPHER
-
Its a selfdescribing error...
- #number curl.SSL_CONNECT_ERROR
-
Its a selfdescribing error...
- #number curl.SSL_ENGINE_INITFAILED
-
Its a selfdescribing error...
- #number curl.SSL_ENGINE_NOTFOUND
-
Its a selfdescribing error...
- #number curl.SSL_ENGINE_SETFAILED
-
Its a selfdescribing error...
- #number curl.SSL_PEER_CERTIFICATE
-
UNDOCUMENTED/NOTHING FOUND
- #number curl.TELNET_OPTION_SYNTAX
-
Its a selfdescribing error...
- #number curl.TIMECOND_IFMODSINCE
-
Condition: If modified since ?
Used for curl.OPT_TIMECONDITION
- #number curl.TIMECOND_IFUNMODSINCE
-
Condition: If unmodified since ?
Used for curl.OPT_TIMECONDITION
- #number curl.TIMECOND_LASTMOD
-
Condition: last modified
Used for curl.OPT_TIMECONDITION
- #number curl.TIMECOND_NONE
-
No time condition
Used for curl.OPT_TIMECONDITION
- #number curl.TOO_MANY_REDIRECTS
-
Its a selfdescribing error...
- #number curl.UNKNOWN_TELNET_OPTION
-
Its a selfdescribing error...
- #number curl.UNSUPPORTED_PROTOCOL
-
Its a selfdescribing error...
- #number curl.URL_MALFORMAT
-
Its a selfdescribing error...
- #number curl.URL_MALFORMAT_USER
-
Its a selfdescribing error...
- #number curl.WRITE_ERROR
-
Its a selfdescribing error...
- #string curl._COPYRIGHT
-
Copyright information of this module.
- #string curl._CURLVERSION
-
The current used CURL version for this module.
- #string curl._DESCRIPTION
-
A description of this module.
- #string curl._NAME
-
The name of this module.
- #string curl._SUPPORTED_CURLVERSION
-
The supported CURL version of this module.
- #string curl._VERSION
-
The current version of luacurl.
- curl.escape(url)
-
Escapes URL #strings.
Parameter
-
#string url
: the url to escape
Return value
#curlobj: the curl-object to perfom your actions on.
-
- curl.new()
-
Use this function to instantiate curl objects.
Return value
#curlobj: the curl-object to perfom your actions on.
- curl.unescape(url)
-
Unescapes URL encoding in #strings.
Parameter
-
#string url
: the url to unescape
Return value
#curlobj: the curl-object to perfom your actions on.
-
Type curlobj
Field(s)
- curlobj.close()
-
This function closes a curl connection created by curl.new
- curlobj.getinfo(info)
-
Get informations for the #curlobj.
Parameter
-
#number info
: infofield of #curl (curl.INFO_???) (e.g. curl.INFOCONNECTTIME)
Return value
the information
-
- curlobj.perform()
-
Call this method to perform a file transfer after all curlobj.setopt calls are made.
- curlobj.setopt(option, ...)
-
Sets options for the #curlobj to be used on the curlobj.perform function.
Parameters
-
#number option
: A field of the curl module (e.g. curl.OPT_AUTOREFERER) -
...
: parameter for the option (See the curl.OPT_??? fields for more information)
Return value
optional return. They will be given in the OPT_??? descriptions.
-