class HTTPClient::Client

Defined in:

http_client.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(url : String) #

[View source]
def self.new(uri : URI) #

[View source]
def self.new(*, max_idle_pool_size = 6, max_pool_size = 0, checkout_timeout : Time::Span = 5.seconds, &block : -> HTTP::Client) #

[View source]

Instance Method Detail

def delete(*args, as type, **kwargs) #

[View source]
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 # => "..."

[View source]
def get(*args, as type, **kwargs) #

[View source]
def head(*args, as type, **kwargs) #

[View source]
def options(*args, as type, **kwargs) #

[View source]
def patch(*args, as type, **kwargs) #

[View source]
def post(*args, as type, **kwargs) #

[View source]
def put(*args, as type, **kwargs) #

[View source]