class HTTPClient::Client
- HTTPClient::Client
- HTTP::Client
- Reference
- Object
Defined in:
http_client.crConstructors
- .new(url : String)
- .new(uri : URI)
- .new(*, max_idle_pool_size = 6, max_pool_size = 0, checkout_timeout : Time::Span = 5.seconds, &block : -> HTTP::Client)
Instance Method Summary
- #delete(*args, as type, **kwargs)
-
#exec(request : HTTP::Request)
Executes a request.
- #get(*args, as type, **kwargs)
- #head(*args, as type, **kwargs)
- #options(*args, as type, **kwargs)
- #patch(*args, as type, **kwargs)
- #post(*args, as type, **kwargs)
- #put(*args, as type, **kwargs)
Constructor Detail
def self.new(*, max_idle_pool_size = 6, max_pool_size = 0, checkout_timeout : Time::Span = 5.seconds, &block : -> HTTP::Client)
#
Instance Method Detail
def exec(request : HTTP::Request)
#
Description copied from class HTTP::Client
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 # => "..."