class Kemal::ParamParser

Overview

Parses the request contents including query_params and body and converts them into a params hash which you can use within the environment context.

Defined in:

kemal/param_parser.cr

Constant Summary

APPLICATION_JSON = "application/json"
MULTIPART_FORM = "multipart/form-data"
PARTS = ["url", "query", "body", "json", "files"] of ::String
URL_ENCODED_FORM = "application/x-www-form-urlencoded"

Constructors

Instance Method Summary

Constructor Detail

def self.new(request : HTTP::Request, url : Hash(String, String) = {} of String => String) #

[View source]

Instance Method Detail

def all_files : Hash(String, Array(Kemal::FileUpload)) #

[View source]
def body #

[View source]
def cleanup_temporary_files #

[View source]
def files #

[View source]
def json #

[View source]
def query #

[View source]
def raw_body : String #

Returns the raw request body, read and cached on first access. Allows multiple handlers to access the body without consuming the IO. Only caches for application/x-www-form-urlencoded and application/json.


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

Updates url params (e.g. after request method override). Used by Context#invalidate_route_cache.


[View source]
def url #

[View source]