class Crest::Response
- Crest::Response
- Reference
- Object
Overview
Response objects have several useful methods:
#body
: The response body as aString
#body_io
: The response body as aIO
#status
: The response status as aHTTP::Status
#status_code
: The HTTP response code#headers
: A hash of HTTP response headers#cookies
: A hash of HTTP cookies set by the server#request
: TheCrest::Request
object used to make the request#http_client_res
: TheHTTP::Client::Response
object#history
: A list of each response received in a redirection chain
Defined in:
crest/response.crConstructors
Instance Method Summary
- #body(*args, **options)
- #body(*args, **options, &)
- #body_io(*args, **options)
- #body_io(*args, **options, &)
- #client_error?(*args, **options)
- #client_error?(*args, **options, &)
- #cookies
-
#filename : String | Nil
Extracts filename from Content-Disposition header
- #headers
- #history : Array
- #http_client_res : HTTP::Client::Response
- #informational?(*args, **options)
- #informational?(*args, **options, &)
-
#inspect
Returns an unambiguous and information-rich string representation of this object, typically intended for developers.
- #invalid?
- #redirect?
- #redirection?(*args, **options)
- #redirection?(*args, **options, &)
- #request : Crest::Request
- #return! : Crest::Response
- #return!(&block : Crest::Response -> )
- #server_error?(*args, **options)
- #server_error?(*args, **options, &)
- #status(*args, **options)
- #status(*args, **options, &)
- #status_code(*args, **options)
- #status_code(*args, **options, &)
- #success?(*args, **options)
- #success?(*args, **options, &)
- #to_curl(*args, **options)
- #to_curl(*args, **options, &)
-
#to_s(io : IO) : Nil
Appends a short String representation of this object which includes its class name and its object address.
- #url : String
Constructor Detail
Instance Method Detail
def inspect
#
Description copied from class Object
Returns an unambiguous and information-rich string representation of this object, typically intended for developers.
This method should usually not be overridden. It delegates to
#inspect(IO)
which can be overridden for custom implementations.
Also see #to_s
.
def to_s(io : IO) : Nil
#
Description copied from class Reference
Appends a short String representation of this object which includes its class name and its object address.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).to_s # => #<Person:0x10a199f20>