class Cossack::Request

Overview

Request built by Client, that can be processed by middleware and a connection.

request.method  # => "POST"
request.uri     # => #<URI:0x11b8ea0 @scheme="http", @host="example.org" ...>
request.body    # => "payload"
request.headers # => #<HTTP::Headers ... >
request.options.connect_timeout  # => 30
request.options.read_timeout     # => 30

Defined in:

cossack/request.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(method : String, uri : URI, headers : HTTP::Headers = HTTP::Headers.new, body : String | Nil = nil, options : Cossack::RequestOptions = RequestOptions.new) #

[View source]
def self.new(method : String, uri : String, headers : HTTP::Headers = HTTP::Headers.new, body : String | Nil = nil, options : Cossack::RequestOptions = RequestOptions.new) #

[View source]

Instance Method Detail

def body : String? #

[View source]
def body=(body : Nil | String) #

[View source]
def headers : HTTP::Headers #

[View source]
def headers=(headers : HTTP::Headers) #

[View source]
def method : String #

[View source]
def method=(method : String) #

[View source]
def options : Cossack::RequestOptions #

[View source]
def options=(options : Cossack::RequestOptions) #

[View source]
def uri : URI #

[View source]
def uri=(uri : URI) #

[View source]