requestHTTP

Performs a synchronous HTTP request on the specified URL.

The requester parameter allows to customize the request and to specify the request body for non-GET requests before it is sent. A response object is then returned or passed to the responder callback synchronously.

This function is a low-level HTTP client facility. It will not perform automatic redirect, caching or similar tasks. For a high-level download facility (similar to cURL), see the vibe.inet.urltransfer module.

Note that it is highly recommended to use one of the overloads that take a responder callback, as they can avoid some memory allocations and are safe against accidentally leaving stale response objects (objects whose response body wasn't fully read). For the returning overloads of the function it is recommended to put a scope(exit) right after the call in which HTTPClientResponse.dropBody is called to avoid this.

See Also

vibe.inet.urltransfer.download

Meta