Easy
handle that should be used instead of creating a new one.
Stores current response payload.
This will not store anything in case NoDataStorage
flag is enabled
Current response length.
Will always be zero in case NoDataStorage
flag is enabled
Internal Easy handle being used
Stores current headers payload.
This will not store anything in case NoDataStorage
flag is enabled
Current headers length.
Will always be zero in case NoDataStorage
flag is enabled
Whether this instance is running or not (perform()
was called).
Make sure to not change their value, otherwise unexpected behavior would happen.
Integer representing the current libcurl version.
It was built the following way:
<8 bits major number> | <8 bits minor number> | <8 bits patch number>.
Version 7.69.1
is therefore returned as 0x074501
/ 476417
This is the default user agent that is going to be used on all Curl
instances.
You can overwrite this in a per instance basis, calling curlHandle.setOpt('USERAGENT', 'my-user-agent/1.0')
, or
by directly changing this property so it affects all newly created Curl
instances.
To disable this behavior set this property to null
.
Returns the number of handles currently open in the internal Multi
handle being used.
Returns libcurl version string.
The string shows which libraries libcurl was built with and their versions, example:
libcurl/7.69.1-DEV OpenSSL/1.1.1d zlib/1.2.11 WinIDN libssh2/1.9.0_DEV nghttp2/1.40.0
Calls curl_global_cleanup()
This is automatically called when the process is exiting.
Calls curl_global_init()
.
For flags see the the enum CurlGlobalInit
.
This is automatically called when the addon is loaded, to disable this, set the environment variable
NODE_LIBCURL_DISABLE_GLOBAL_INIT_CALL=false
This is a object with members resembling the CURLINFO_*
libcurl constants.
It can be used with Easy#getInfo
or Curl#getInfo
.
See the official documentation of curl_easy_getinfo()
for reference.
CURLINFO_EFFECTIVE_URL
becomes Curl.info.EFFECTIVE_URL
This is a object with members resembling the CURLOPT_*
libcurl constants.
It can be used with Easy#setOpt
or Curl#setOpt
.
See the official documentation of curl_easy_setopt()
for reference.
CURLOPT_URL
becomes Curl.option.URL
Close this handle.
NOTE: After closing the handle, it must not be used anymore. Doing so will throw an error.
Official libcurl documentation: curl_easy_cleanup()
This is the default callback passed to setOpt('HEADERFUNCTION', cb)
.
This is the default callback passed to setOpt('WRITEFUNCTION', cb)
.
Disables a feature, must not be used while a request is running.
Use CurlFeature
for predefined constants.
Duplicate this handle with all their options. Keep in mind that, by default, this also means all event listeners.
Official libcurl documentation: curl_easy_duphandle()
If you don't want to copy the event listeners, set this to false
.
Enables a feature, must not be used while a request is running.
Use CurlFeature
for predefined constants.
Retrieves some information about the last request made by a handle.
Official libcurl documentation: curl_easy_getinfo()
Info name or integer value. Use Curl.info
for predefined constants.
Use this function to pause / unpause a connection.
The bitmask argument is a set of bits that sets the new state of the connection.
Use CurlPause
for predefined constants.
Official libcurl documentation: curl_easy_pause()
Add this instance to the processing queue. This method should be called only one time per request, otherwise it will throw an error.
Reset this handle options to their defaults.
This will put the handle in a clean state, as if it was just created.
Official libcurl documentation: curl_easy_reset()
Sets an option the handle.
This overloaded method has never
as type for the arguments
because one of the other overloaded signatures must be used.
Official libcurl documentation: curl_easy_setopt()
Option name or integer value. Use Curl.option
for predefined constants.
The value of the option, value type depends on the option being set.
Use Curl.option
for predefined constants.
Official libcurl documentation: curl_easy_setopt()
Use Curl.option
for predefined constants.
Official libcurl documentation: curl_easy_setopt()
Use Curl.option
for predefined constants.
Official libcurl documentation: curl_easy_setopt()
Use Curl.option
for predefined constants.
Official libcurl documentation: curl_easy_setopt()
Use Curl.option
for predefined constants.
Official libcurl documentation: curl_easy_setopt()
Use Curl.option
for predefined constants.
Official libcurl documentation: curl_easy_setopt()
Use Curl.option
for predefined constants.
Official libcurl documentation: curl_easy_setopt()
Use Curl.option
for predefined constants.
Official libcurl documentation: curl_easy_setopt()
Use Curl.option
for predefined constants.
Official libcurl documentation: curl_easy_setopt()
Use Curl.option
for predefined constants.
Official libcurl documentation: curl_easy_setopt()
Use Curl.option
for predefined constants.
Official libcurl documentation: curl_easy_setopt()
Use Curl.option
for predefined constants.
Official libcurl documentation: curl_easy_setopt()
Use Curl.option
for predefined constants.
Official libcurl documentation: curl_easy_setopt()
Use Curl.option
for predefined constants.
Official libcurl documentation: curl_easy_setopt()
Use Curl.option
for predefined constants.
Official libcurl documentation: curl_easy_setopt()
The option XFERINFOFUNCTION
was introduced in curl version 7.32.0
,
versions older than that should use PROGRESSFUNCTION
.
If you don't want to mess with version numbers you can use this method,
instead of directly calling Curl#setOpt
.
NOPROGRESS
should be set to false to make this function actually get called.
Perform any connection upkeep checks.
Official libcurl documentation: curl_easy_upkeep()
Returns an object with a representation of the current libcurl version and their features/protocols.
This is basically curl_version_info()
Returns a string that looks like the one returned by
curl -V
Example:
Version: libcurl/7.69.1-DEV OpenSSL/1.1.1d zlib/1.2.11 WinIDN libssh2/1.9.0_DEV nghttp2/1.40.0
Protocols: dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp
Features: AsynchDNS, IDN, IPv6, Largefile, SSPI, Kerberos, SPNEGO, NTLM, SSL, libz, HTTP2, HTTPS-proxy
Useful if you want to check if the current libcurl version is greater or equal than another one.
major
minor
patch
Generated using TypeDoc
Wrapper around
Easy
class with a more nodejs-friendly interface.This uses an internal
Multi
instance to asynchronous fire the requests.