Constructor.
SSL context and adapter to use for TLS.
SSL context and adapter to use for TLS.
Connect to a request's destination.
Pop off a request from the queue and return it, while incrementing sentRequests.
Called when the underlying connection (TCP, TLS...) is established.
Called when we're ready to send a request.
Returns true when we are connected but not waiting for anything. Requests can always be sent immediately when this is true.
Encode and send a request (headers and body) to the connection. Has no other side effects.
Called to set up the client to be ready to receive a response.
Received data handler used while we are receiving headers.
Called when we've received some data from the response headers.
Called when we've read all headers (currentResponse.headers is populated).
Received data handler used while we are receiving the response body.
Called when we've received some data from the response body.
Called when we've read the entirety of the response. Any left-over data is in rest. disconnectReason is null if there was no disconnect.
Wrap up and return the current response, and clean up the client for another request.
Submit a received response.
Disconnect handler
User-Agent header to advertise.
Keep connection alive after one request.
Send requests without waiting for a response. Requires keepAlive.
Fix up a response to set up required headers, etc. Done automatically by request, unless called with normalize == false.
Send a HTTP request.
Returns true if a connection is active (whether due to an in-flight request or due to keep-alive).
Close the connection to the HTTP server.
User-supplied callback for handling the response.
Optional disconnect callback. Generally using this only makes sense with a persistent connection with keepAlive=true.
HTTPS client.