class Halite::Request

Defined in:

halite/request.cr

Constant Summary

METHODS = ["GET", "PUT", "POST", "DELETE", "HEAD", "PATCH", "OPTIONS"] of ::String

Allowed methods

See more: https://github.com/crystal-lang/crystal/blob/863f301cfe9e9757a6bf1a494ab7bf49bfc07a06/src/http/client.cr#L329

SCHEMES = ["http", "https"] of ::String

Allowed schemes

USER_AGENT = "Halite/#{Halite::VERSION}"

Request user-agent by default

Constructors

Instance Method Summary

Constructor Detail

def self.new(verb : String, uri : URI, headers : HTTP::Headers = HTTP::Headers.new, body : String = "") #

[View source]

Instance Method Detail

def body : String #

The payload of request


[View source]
def domain #

@return URI with the scheme, user, password, port and host combined


[View source]
def full_path #

@return String with the path, query and fragment combined


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

The headers of request


[View source]
def redirect(uri : String, verb = @verb) #

Returns new Request with updated uri


[View source]
def scheme : String #

The scheme name of request


[View source]
def uri : URI #

The uri of request


[View source]
def verb : String #

The verb name of request


[View source]