class Grip::Parsers::ParameterBox

Defined in:

grip/parsers/parameter_box.cr

Constant Summary

APPLICATION_JSON = "application/json"
EMPTY_FILE = {} of String => FileUpload
EMPTY_JSON = {} of String => AllParamTypes
EMPTY_PARAMS = HTTP::Params.new({} of String => Array(String))
EMPTY_STRING_HASH = {} of String => String

Use class-level empty instances to avoid allocations

FLAG_BODY = 4_u8
FLAG_FILE = 16_u8
FLAG_JSON = 8_u8
FLAG_QUERY = 2_u8
FLAG_URL = 1_u8
MULTIPART_FORM = "multipart/form-data"
URL_ENCODED_FORM = "application/x-www-form-urlencoded"

Constructors

Instance Method Summary

Constructor Detail

def self.new(request : HTTP::Request, url : Hash(String, String) = EMPTY_STRING_HASH) #

[View source]

Instance Method Detail

def body : HTTP::Params #

[View source]
def file : Hash(String, FileUpload) #

[View source]
def json : Hash(String, AllParamTypes) #

[View source]
def query : HTTP::Params #

[View source]
def url : Hash(String, String) #

URL params - most frequently accessed, optimize heavily


[View source]