class
Kemal::ParamParser
- Kemal::ParamParser
- Reference
- Object
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.crConstant 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
-
#all_files
Files uploaded under a
name[]field, every part of each. - #body
- #cleanup_temporary_files
- #files
- #json
- #query
-
#raw_body : String
Returns the raw request body, read and cached on first access, so several handlers can look at it without consuming the IO.
-
#update_url_params(new_url : Hash(String, String))
Updates url params (e.g.
- #url
Constructor Detail
Instance Method Detail
Files uploaded under a name[] field, every part of each. Parses the request body
on first access, like #files.
Returns the raw request body, read and cached on first access, so several
handlers can look at it without consuming the IO. Subject to
Kemal.config.max_request_body_size like every other read of the body.
A multipart/form-data body is the one exception: parse_files streams it
part by part, and reading it whole here would consume the stream those parts
come from. It returns "" for such a request; use #files and #body instead.
Updates url params (e.g. after request method override). Used by Context#invalidate_route_cache.