class Cossack::Response
- Cossack::Response
- Reference
- Object
Overview
Represents HTTP response.
response = Cossack::Response.new(204, {"Content-Length" => "20"}, "Saluton Esperantujo!")
response.status # => 204
response.headers["Content-Length"] # => "20"
response.body # => "Saluton Esperantujo!"
response.success? # => true
response.redirection? # => false
response.client_error? # => false
response.server_error? # => false
Defined in:
cossack/response.crConstructors
- .new(status : Int32, headers : HTTP::Headers, body : String)
- .new(status : Int32, headers : Hash(String, String), body : String)
- .new(status : Int32, body : String)
Instance Method Summary
- #body : String
- #client_error?
- #headers : HTTP::Headers
- #redirection?
-
#server_error?
Is this a 5xx response?
- #status : Int32
-
#success?
Is this a 2xx response?