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 = "") #

Instance Method Detail

def body : String #

The payload of request


def domain #

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


def full_path #

@return String with the path, query and fragment combined


def headers : HTTP::Headers #

The headers of request


def redirect(uri : String, verb = @verb) #

Returns new Request with updated uri


def scheme : String #

The scheme name of request


def uri : URI #

The uri of request


def verb : String #

The verb name of request