class Crest::Response

Overview

Response objects have several useful methods:

Defined in:

crest/response.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(http_client_res : HTTP::Client::Response, request : Crest::Request) #

[View source]

Instance Method Detail

def body(*args, **options) #

[View source]
def body(*args, **options, &) #

[View source]
def body_io(*args, **options) #

[View source]
def body_io(*args, **options, &) #

[View source]
def client_error?(*args, **options) #

[View source]
def client_error?(*args, **options, &) #

[View source]
def content_length : Int64 #

Size of the message body in bytes taken from "Content-Length" header


[View source]
def cookies #

[View source]
def filename : String | Nil #

Extracts filename from "Content-Disposition" header


[View source]
def headers #

[View source]
def history : Array #

[View source]
def http_client_res : HTTP::Client::Response #

[View source]
def informational?(*args, **options) #

[View source]
def informational?(*args, **options, &) #

[View source]
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.


[View source]
def invalid? #

[View source]
def redirect? #

[View source]
def redirection?(*args, **options) #

[View source]
def redirection?(*args, **options, &) #

[View source]
def request : Crest::Request #

[View source]
def return! : Crest::Response #

[View source]
def return!(&block : Crest::Response -> ) #

[View source]
def server_error?(*args, **options) #

[View source]
def server_error?(*args, **options, &) #

[View source]
def status(*args, **options) #

[View source]
def status(*args, **options, &) #

[View source]
def status_code(*args, **options) #

[View source]
def status_code(*args, **options, &) #

[View source]
def success?(*args, **options) #

[View source]
def success?(*args, **options, &) #

[View source]
def to_curl(*args, **options) #

[View source]
def to_curl(*args, **options, &) #

[View source]
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>

[View source]
def url : String #

[View source]