Skip to content

class HTTP::Client::Response
inherits Reference

Class methods

.from_io(io, ignore_body = false, decompress = true)

View source

.from_io(io, ignore_body = false, decompress = true

View source

.from_io?(io, ignore_body = false, decompress = true)

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.

View 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.

View source

.mandatory_body?(status : HTTP::Status) : Bool

View source

.supports_chunked?(version) : Bool

View source

.new(status : HTTP::Status, body : String? = nil, headers : Headers = Headers.new, status_message = nil, version = "HTTP/1.1", body_io = nil)

View source

.new(status_code : Int32, body : String? = nil, headers : Headers = Headers.new, status_message = nil, version = "HTTP/1.1", body_io = nil)

View source

Methods

#body

View source

#body_io : IO

View source

#body_io? : IO?

View source

#charset : String?

View source

#content_type : String?

View source

#cookies

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

View source

#headers : Headers

View source

#keep_alive?

View source

#status_code

Convenience method to retrieve the HTTP status code.

View source

#status_message : String?

View source

#success?

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

View source

#to_io(io)

View source

#version : String

View source