class Cossack::Client

Defined in:

cossack/client.cr

Constant Summary

DEFAULT_TIMEOUT = 30.0
USER_AGENT = "Cossack v#{VERSION}"

Constructors

Instance Method Summary

Constructor Detail

def self.new(base_url = nil, connect_timeout : Float64 | Int32 = DEFAULT_TIMEOUT, read_timeout : Float64 | Int32 = DEFAULT_TIMEOUT, &) #

[View source]
def self.new(base_url = nil, connect_timeout : Float64 | Int32 = DEFAULT_TIMEOUT, read_timeout : Float64 | Int32 = DEFAULT_TIMEOUT) #

When block is not given.


[View source]

Instance Method Detail

def add_middleware(md : Middleware) #

[View source]
def base_uri : URI #

[View source]
def connection #

[View source]
def connection=(connection : Proc(Request, Response) | Connection) #

[View source]
def delete(url_or_path : String, params : Params = Params.new) : Response #

[View source]
def delete(url_or_path : String, params : Params | Nil = nil, &) : Response #

[View source]
def get(url_or_path : String, params : Params = Params.new) : Response #

[View source]
def get(url_or_path : String, params : Params | Nil = nil, &) : Response #

[View source]
def head(url_or_path : String, params : Params = Params.new) : Response #

[View source]
def head(url_or_path : String, params : Params | Nil = nil, &) : Response #

[View source]
def headers : HTTP::Headers #

[View source]
def options(url_or_path : String, params : Params = Params.new) : Response #

[View source]
def options(url_or_path : String, params : Params | Nil = nil, &) : Response #

[View source]
def patch(url_or_path : String, body : String = "") #

[View source]
def patch(url_or_path : String, body : String = "", &) #

[View source]
def post(url_or_path : String, body : String = "") #

[View source]
def post(url_or_path : String, body : String = "", &) #

[View source]
def put(url_or_path : String, body : String = "") #

[View source]
def put(url_or_path : String, body : String = "", &) #

[View source]
def set_connection(&block : Request -> Response) #

[View source]