class

HTTP::Client::Response

Inherits Reference / Object

Constructors

from_io(io : IO, ignore_body : Bool = false, decompress : Bool = true) : self
Source
new(status : HTTP::Status, body : String | Nil = nil, headers : Headers = Headers.new, status_message : String | Nil = nil, version : String = "HTTP/1.1", body_io : IO | Nil = nil)
Source
new(status_code : Int32, body : String | Nil = nil, headers : Headers = Headers.new, status_message : String | Nil = nil, version : String = "HTTP/1.1", body_io : IO | Nil = nil) : self
Source

Class methods

from_io(io, ignore_body = false, decompress = true, &)
Source
from_io?(io : IO, ignore_body : Bool = false, decompress : Bool = true) : self | Nil

Parses an HTTP::Client::Response from the given IO. Might return nil if there's no data in the IO, which probably means that the connection was closed.

Source
from_io?(io, ignore_body = false, decompress = true, &)

Parses an HTTP::Client::Response from the given IO and yields it to the block. Might yield nil if there's no data in the IO, which probably means that the connection was closed.

Source
mandatory_body?(status : HTTP::Status) : Bool
Source
supports_chunked?(version : String) : Bool
Source

Instance methods

body
Source
body?
Source
body_io
Source
body_io?
Source
charset
Source
content_type
Source
cookies

Returns a convenience wrapper around querying and setting cookie related headers, see HTTP::Cookies.

Source
headers
Source
keep_alive?
Source
mime_type
Source
status
Source
status_code

Convenience method to retrieve the HTTP status code.

Source
status_message
Source
success?

Returns true if the response status code is between 200 and 299.

Source
to_io(io : IO) : Nil
Source
version
Source