class Cossack::Client
- Cossack::Client
- Reference
- Object
Defined in:
cossack/client.crConstant Summary
-
DEFAULT_TIMEOUT =
30.0
-
USER_AGENT =
"Cossack v#{VERSION}"
Constructors
- .new(base_url = nil, connect_timeout : Float64 | Int32 = DEFAULT_TIMEOUT, read_timeout : Float64 | Int32 = DEFAULT_TIMEOUT, &)
-
.new(base_url = nil, connect_timeout : Float64 | Int32 = DEFAULT_TIMEOUT, read_timeout : Float64 | Int32 = DEFAULT_TIMEOUT)
When block is not given.
Instance Method Summary
- #add_middleware(md : Middleware)
- #base_uri : URI
- #connection
- #connection=(connection : Proc(Request, Response) | Connection)
- #delete(url_or_path : String, params : Params = Params.new) : Response
- #delete(url_or_path : String, params : Params | Nil = nil, &) : Response
- #get(url_or_path : String, params : Params = Params.new) : Response
- #get(url_or_path : String, params : Params | Nil = nil, &) : Response
- #head(url_or_path : String, params : Params = Params.new) : Response
- #head(url_or_path : String, params : Params | Nil = nil, &) : Response
- #headers : HTTP::Headers
- #options(url_or_path : String, params : Params = Params.new) : Response
- #options(url_or_path : String, params : Params | Nil = nil, &) : Response
- #patch(url_or_path : String, body : String = "")
- #patch(url_or_path : String, body : String = "", &)
- #post(url_or_path : String, body : String = "")
- #post(url_or_path : String, body : String = "", &)
- #put(url_or_path : String, body : String = "")
- #put(url_or_path : String, body : String = "", &)
- #set_connection(&block : Request -> Response)
Constructor Detail
def self.new(base_url = nil, connect_timeout : Float64 | Int32 = DEFAULT_TIMEOUT, read_timeout : Float64 | Int32 = DEFAULT_TIMEOUT, &)
#
def self.new(base_url = nil, connect_timeout : Float64 | Int32 = DEFAULT_TIMEOUT, read_timeout : Float64 | Int32 = DEFAULT_TIMEOUT)
#
When block is not given.