class

HTTPClient::Client

Inherits HTTP::Client / Reference / Object

Constructors

new(url : String)
Source
new(uri : URI)
Source
new(*, max_idle_pool_size = 6, max_pool_size = 0, checkout_timeout : Time::Span = 5.seconds, &block : -> HTTP::Client)
Source

Instance methods

checkout
Source
delete(*args, as type, **kwargs)
Source
exec(request : HTTP::Request)

Executes a request. The response will have its body as a String, accessed via HTTP::Client::Response#body.

require "http/client"

client = HTTP::Client.new "www.example.com"
response = client.exec HTTP::Request.new("GET", "/")
response.body # => "..."
Source
get(*args, as type, **kwargs)
Source
head(*args, as type, **kwargs)
Source
options(*args, as type, **kwargs)
Source
patch(*args, as type, **kwargs)
Source
post(*args, as type, **kwargs)
Source
put(*args, as type, **kwargs)
Source