Compression

If compress isn't set to false, and no Accept-Encoding header is explicitly specified,
an HTTP::Client will add an "Accept-Encoding": "gzip, deflate" header, and automatically decompress
the response body/body_io.

Encoding

If a response has a Content-Type header with a charset, that charset is set as the encoding
of the returned IO (or used for creating a String for the body). Invalid bytes in the given encoding
are silently ignored when reading text content.

Constructor Detail

Creates a new HTTP client from a URI. Parses the host, port,
and tls configuration from the URI provided. Port defaults to
80 if not specified unless using the https protocol, which defaults
to port 443 and sets tls to true.

Creates a new HTTP client from a URI, yields it to the block and closes the
client afterwards. Parses the host, port, and tls configuration from
the URI provided. Port defaults to 80 if not specified unless using the
https protocol, which defaults to port 443 and sets tls to true.

Class Method Detail

Executes a DELETE request with form data and yields the response to the block.
The response will have its body as an IO accessed via HTTP::Client::Response#body_io.
The "Content-Type" header is set to "application/x-www-form-urlencoded".

Executes a GET request with form data and yields the response to the block.
The response will have its body as an IO accessed via HTTP::Client::Response#body_io.
The "Content-Type" header is set to "application/x-www-form-urlencoded".

Executes a HEAD request with form data and yields the response to the block.
The response will have its body as an IO accessed via HTTP::Client::Response#body_io.
The "Content-Type" header is set to "application/x-www-form-urlencoded".

Executes a OPTIONS request with form data and yields the response to the block.
The response will have its body as an IO accessed via HTTP::Client::Response#body_io.
The "Content-Type" header is set to "application/x-www-form-urlencoded".

Executes a PATCH request with form data and yields the response to the block.
The response will have its body as an IO accessed via HTTP::Client::Response#body_io.
The "Content-Type" header is set to "application/x-www-form-urlencoded".

Executes a POST request with form data and yields the response to the block.
The response will have its body as an IO accessed via HTTP::Client::Response#body_io.
The "Content-Type" header is set to "application/x-www-form-urlencoded".

Executes a PUT request with form data and yields the response to the block.
The response will have its body as an IO accessed via HTTP::Client::Response#body_io.
The "Content-Type" header is set to "application/x-www-form-urlencoded".

Executes a DELETE request with form data and yields the response to the block.
The response will have its body as an IO accessed via HTTP::Client::Response#body_io.
The "Content-type" header is set to "application/x-www-form-urlencoded".

Executes a DELETE request with form data and yields the response to the block.
The response will have its body as an IO accessed via HTTP::Client::Response#body_io.
The "Content-Type" header is set to "application/x-www-form-urlencoded".

Executes a GET request with form data and yields the response to the block.
The response will have its body as an IO accessed via HTTP::Client::Response#body_io.
The "Content-type" header is set to "application/x-www-form-urlencoded".

Executes a GET request with form data and yields the response to the block.
The response will have its body as an IO accessed via HTTP::Client::Response#body_io.
The "Content-Type" header is set to "application/x-www-form-urlencoded".

Executes a HEAD request with form data and yields the response to the block.
The response will have its body as an IO accessed via HTTP::Client::Response#body_io.
The "Content-type" header is set to "application/x-www-form-urlencoded".

Executes a HEAD request with form data and yields the response to the block.
The response will have its body as an IO accessed via HTTP::Client::Response#body_io.
The "Content-Type" header is set to "application/x-www-form-urlencoded".

Executes a OPTIONS request with form data and yields the response to the block.
The response will have its body as an IO accessed via HTTP::Client::Response#body_io.
The "Content-type" header is set to "application/x-www-form-urlencoded".

Executes a OPTIONS request with form data and yields the response to the block.
The response will have its body as an IO accessed via HTTP::Client::Response#body_io.
The "Content-Type" header is set to "application/x-www-form-urlencoded".

Executes a PATCH request with form data and yields the response to the block.
The response will have its body as an IO accessed via HTTP::Client::Response#body_io.
The "Content-type" header is set to "application/x-www-form-urlencoded".

Executes a PATCH request with form data and yields the response to the block.
The response will have its body as an IO accessed via HTTP::Client::Response#body_io.
The "Content-Type" header is set to "application/x-www-form-urlencoded".

Executes a POST request with form data and yields the response to the block.
The response will have its body as an IO accessed via HTTP::Client::Response#body_io.
The "Content-Type" header is set to "application/x-www-form-urlencoded".

Executes a POST request with form data and yields the response to the block.
The response will have its body as an IO accessed via HTTP::Client::Response#body_io.
The "Content-type" header is set to "application/x-www-form-urlencoded".

Executes a PUT request with form data and yields the response to the block.
The response will have its body as an IO accessed via HTTP::Client::Response#body_io.
The "Content-type" header is set to "application/x-www-form-urlencoded".

Executes a PUT request with form data and yields the response to the block.
The response will have its body as an IO accessed via HTTP::Client::Response#body_io.
The "Content-Type" header is set to "application/x-www-form-urlencoded".