Class options

Any libcurl option could be specified as an option of methods ^curl:options[] and ^curl:load[] (see documentation). Options' names should be written in lowercase and without the CURLOPT_ prefix.

Also, Parser supports the following options:

Option

Default

Description

$.library[/path/to/libcurl.so]

unix - libcurl.so
win32 - libcurl.dll
Full path to dynamical libcurl library.
$.charset[charset]

correspondes $request:charset
Charset used in documents on remote server. This charset is used to transcode request string. This charset is used to transcode response body if HTTP response does not contain charset.
$.response-charset[charset]
taken from HTTP response header
Force specify charset for response body.
$.name[file name]

NONAME.DAT
The name of the created file object.
$.mode[text|binary]

text
The mode of the created file object.
$.content-type[CONTENT-TYPE]

taken from HTTP response header
The content-type of the created file object.


Supported libcurl options in alphabetical order:

Option

Type

libcurl analog

Description

accept_encoding

string

CURLOPT_ACCEPT_ENCODING
Compresion for the request: gzip or deflate. (Old option name-encoding-is also supported)
autoreferer

int

CURLOPT_AUTOREFERER
Set the Referer header automatically.
cainfo

string

CURLOPT_CAINFO
See libcurl documentation.
capath

string

CURLOPT_CAPATH
See libcurl documentation.
connecttimeout

int

CURLOPT_CONNECTTIMEOUT
The maximum time in seconds that you allow the connection to the server to take.
connecttimeout_ms

int

CURLOPT_CONNECTTIMEOUT_MS
The maximum time in milliseconds that you allow the connection to the server to take.
cookie

string

CURLOPT_COOKIE
String with cookies (name1=content1; name2=content2;...).
cookielist

string

CURLOPT_COOKIELIST
String with cookies (read about differences from cookie option in libcurl documentation)
cookiesession

int

CURLOPT_COOKIESESSION
See libcurl documentation.
copypostfields

string, file

CURLOPT_COPYPOSTFIELDS
The body of POST-request.
crlfile

string

CURLOPT_CRLFILE
See libcurl documentation.
customrequest

string

CURLOPT_CUSTOMREQUEST
Custom HTTP method.
failonerror

int

CURLOPT_FAILONERROR
Fail if HTTP code returned is equal or larger then 400.
followlocation

int

CURLOPT_FOLLOWLOCATION
Follow any Location header.
forbid_reuse

int

CURLOPT_FORBID_REUSE
See libcurl documentation.
fresh_connect

int

CURLOPT_FRESH_CONNECT
Next transfer will use a new connection by force.
http_version

string

CURLOPT_HTTP_VERSION
HTTP protocol varsion. Allowed values: 1.0, 1.1, 2, 2.0, 2TLS, 2ONLY.
http_content_decoding

int

CURLOPT_HTTP_CONTENT_DECODING
See libcurl documentation.
http_transfer_decoding

int

CURLOPT_HTTP_TRANSFER_DECODING
See libcurl documentation.
httpauth

int

CURLOPT_HTTPAUTH
HTTP-authorization method (CURLAUTH_NONE = 0, CURLAUTH_BASIC = (1<<0), CURLAUTH_DIGEST = (1<<1), CURLAUTH_GSSNEGOTIATE = (1<<2), CURLAUTH_NTLM = (1<<3), CURLAUTH_DIGEST_IE = (1<<4), CURLAUTH_NTLM_WB = (1<<5), CURLAUTH_ONLY = (1<<31), CURLAUTH_ANY = (~CURLAUTH_DIGEST_IE), CURLAUTH_ANYSAFE = (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))).
httpget

int

CURLOPT_HTTPGET
Use GET HTTP method.
httpheader

hash

CURLOPT_HTTPHEADER
HTTP-headers.
httppost

hash

CURLOPT_HTTPPOST
Multipart/formdata HTTP POST to be made to pass data on to the server.
httpproxytunnel

int

CURLOPT_HTTPPROXYTUNNEL
Tunnel all operations through a given HTTP proxy.
ignore_content_length

int

CURLOPT_IGNORE_CONTENT_LENGTH
Ignore the Content-Length header. This is useful for Apache 1.x which will report incorrect content length for files over 2GB.
interface

string

CURLOPT_INTERFACE
Interface name to use as outgoing network interface.
ipresolve

int

CURLOPT_IPRESOLVE
1-use IPv4 (default), 2-use IPv6.
issuercert

string

CURLOPT_ISSUERCERT
Filename holding a CA certificate.
keypasswd

string

CURLOPT_KEYPASSWD
The password required to use the private key.

localport

int

CURLOPT_LOCALPORT
Local port.
low_speed_limit

int

CURLOPT_LOW_SPEED_LIMIT
The transfer speed in bytes per second during low_speed_time.
low_speed_time

int

CURLOPT_LOW_SPEED_TIME
The maxinum time in seconds that the transfer should be below the low_speed_limit for the library to consider it is too slow and abort.
maxconnects

int

CURLOPT_MAXCONNECTS
The maximum amount of simultaneously open connections.
maxfilesize

int

CURLOPT_MAXFILESIZE
If the file requested is larger than this value, the transfer will not start.
maxredirs

int

CURLOPT_MAXREDIRS
Maximum number or redirects.
nobody

int

CURLOPT_NOBODY
Use HEAD method.
password

string

CURLOPT_PASSWORD
Password.
port

int

CURLOPT_PORT
Port.
post

int

CURLOPT_POST
Use POST method.
postfields

string, file

CURLOPT_POSTFIELDS
The body of POST-request.
postredir

int

CURLOPT_POSTREDIR
See libcurl documentation.
proxy

string

CURLOPT_PROXY
Proxy-server address.
proxyauth

int

CURLOPT_PROXYAUTH
Authorization type (see httpauth).
proxyport

int

CURLOPT_PROXYPORT
Proxy-server port.
proxytype

int

CURLOPT_PROXYTYPE
Proxy type:
0 - HTTP,
1 - HTTP_1_0,
4 - SOCKS4,
5 - SOCKS5,
6 - SOCKS4A,
7 - SOCKS5_HOSTNAME.
proxyuserpwd

string

CURLOPT_PROXYUSERPWD
Proxy-server user name and password.
range

string

CURLOPT_RANGE
The specified range you want.
referer

string

CURLOPT_REFERER
Referer header.
ssl_cipher_list

string

CURLOPT_SSL_CIPHER_LIST
See libcurl documentation.
ssl_sessionid_cache

int

CURLOPT_SSL_SESSIONID_CACHE
Enable or disable SSL session-ID caching.
ssl_verifyhost

int

CURLOPT_SSL_VERIFYHOST
Verifies that the server cert is for the server it is known as.
ssl_verifypeer

int

CURLOPT_SSL_VERIFYPEER
Verifies the authenticity of the peer's certificate.
sslcert

string

CURLOPT_SSLCERT
File name of your certificate.
sslcerttype

string

CURLOPT_SSLCERTTYPE
SSL-certificate type.
sslengine

string

CURLOPT_SSLENGINE
See libcurl documentation.
sslengine_default

string

CURLOPT_SSLENGINE_DEFAULT
See libcurl documentation.
sslkey

string

CURLOPT_SSLKEY
File name of your private key.
sslkeytype

string

CURLOPT_SSLKEYTYPE
SSL-key type.
sslversion

int

CURLOPT_SSLVERSION
Protocol version for SSL/TLS connection:
0 - default
1 - TLSv1 (TLS 1.x),
2 - SSLv2,
3 - SSLv3,
4 - TLSv1_0,
5 - TLSv1_1,
6 - TLSv1_2.
stderr

string

CURLOPT_STDERR
Redirect stderr into specified stream.
timeout

int

CURLOPT_TIMEOUT
Timeout in seconds.
timeout_ms

int

CURLOPT_TIMEOUT_MS
Timeout in miliseconds.
unrestricted_auth

int

CURLOPT_UNRESTRICTED_AUTH
Continue to send authentication when following locations, even when hostname changed.
url

string

CURLOPT_URL
URL.
useragent

string

CURLOPT_USERAGENT
User-Agent header.
username

string

CURLOPT_USERNAME
User name.
userpwd

string

CURLOPT_USERPWD
User name and password.
verbose

int

CURLOPT_VERBOSE
Display a lot of verbose information about its operations into stderr.



Copyright © 1997–2021 Art. Lebedev Studio | http://www.artlebedev.com Last updated: 26.01.2021