ReadonlyidThis is the unique ID of the Easy handle.
This ID is also unique across threads.
ReadonlyisThis will be true if the handle was added to a Multi handle.
ReadonlyisThis will be true if monitorSocketEvents was called.
ReadonlyisThis will be true if close was not called.
ReadonlyisReadonlyisReadonlypauseYou can set this to anything - Use it to bind some data to this Easy instance.
This will not be copied to other instaces created when duplicating this one.
Close this handle and dispose any resources bound to it. After closed, the handle MUST not be used again, doing so will throw an Error.
This is basically the same than curl_easy_cleanup()
Duplicate this handle with all their options and callbacks.
Official libcurl documentation: curl_easy_duphandle()
Official libcurl documentation: curl_easy_getinfo()
Info to retrieve. Use Curl.info for predefined constants.
Returns information about the finished connection.
Official libcurl documentation: curl_easy_getinfo()
Info to retrieve. Use Curl.info for predefined constants.
Start monitoring for events in the connection socket used by this handle.
This is only useful if using the onSocketEvent callback.
This method will throw an Error if the handle is already monitoring socket events.
You can use isMonitoringSockets to check if socket events are already being monitored or not.
This method is only useful when the internal polling of the connection socket is enabled by calling
monitorSocketEvents.
The passed callback is going to be called everytime there are changes to the connection socket.
One use case for this is when using the send and recv methods
A full example is available at examples/15-send-recv-methods.js
Pass null to remove the current callback set.
Using this function, you can explicitly mark a running connection to get paused, and you can unpause a connection that was previously paused.
Use the CurlPause enum for predefined constants.
Official libcurl documentation: curl_easy_pause()
Performs the entire request in a blocking manner and returns when done.
Official libcurl documentation: curl_easy_perform()
Receives data over the established connection, data will be written to the passed buffer.
See also onSocketEvent.
Official libcurl documentation: curl_easy_recv()
Reset this handle to their original state.
This method is useful if you plan to reuse this handle later on.
Official libcurl documentation: curl_easy_reset()
Sends arbitrary data over the established connection.
See also onSocketEvent.
Official libcurl documentation: curl_easy_send()
Build and set a MIME structure from a declarative configuration.
This is a high-level method that accepts an array of MIME part specifications
and internally builds a CurlMime structure, then sets it using the
MIMEPOST option. This is the recommended way to create multipart form data.
For stream-based parts, the unpause callback is automatically generated, so you don't need to provide it.
Available since libcurl 7.56.0.
Array of MIME part specifications
This Easy instance for method chaining
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.
You can either return a single CurlHstsReadCallbackResult object or an array of CurlHstsReadCallbackResult objects.
If returning an array, the callback will only be called once per request.
If returning a single object, the callback will be called multiple times until null is returned.
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()
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()
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()
Stop monitoring for events in the connection socket used by this handle.
This method will throw an Error if the handle is not monitoring socket events.
You can use isMonitoringSockets to check if socket events are already being monitored or not.
Perform any connection upkeep checks.
Official libcurl documentation: curl_easy_upkeep()
Get WebSocket frame metadata when called from within a WRITEFUNCTION callback.
This function provides additional information about the current WebSocket frame being received. It only works from within the callback, and only when receiving WebSocket data.
Requires libcurl >= 7.86.0
Official libcurl documentation: curl_ws_meta()
Frame metadata or null if not available
Receive WebSocket data when using CONNECT_ONLY mode.
Retrieves as much as possible of a received WebSocket frame into the buffer, but not more than buflen bytes.
Check meta.bytesleft to determine whether the complete frame has been received.
If more payload is pending, call this function again with an updated buffer to resume receiving.
Requires libcurl >= 7.86.0
Official libcurl documentation: curl_ws_recv()
Send WebSocket data when using CONNECT_ONLY mode.
Sends a specific message chunk over an established WebSocket connection.
flags must contain at least one flag indicating the type of the message (Text, Binary, Close, Ping, Pong).
For fragmented messages, set the Cont bit in all frames except the final one.
Requires libcurl >= 7.86.0
Official libcurl documentation: curl_ws_send()
The data to send
Frame type and flags from CurlWs
Optionalfragsize: numberOptional fragment size, only used with CURLWS_OFFSET flag
Start a new WebSocket frame.
This should only be called from within a READFUNCTION callback. Calling it from anywhere else is undefined behavior.
Official libcurl documentation: curl_ws_start_frame()
StaticstrReturns a description for the given error code.
Official libcurl documentation: curl_easy_strerror()
Easyclass that acts as an wrapper around the libcurl connection handle.It can be used by itself, in a synchronous way:
or with the Multi class, allowing asynchronous usage.