class
Amber::Router::Params
- Amber::Router::Params
- Reference
- Object
Defined in:
amber/router/params.crConstant Summary
-
APPLICATION_JSON =
"application/json" -
MULTIPART_FORM =
"multipart/form-data" -
TYPE_EXT_REGEX =
Amber::Support::MimeTypes::TYPE_EXT_REGEX -
URL_ENCODED_FORM =
"application/x-www-form-urlencoded"
Constructors
Class Method Summary
-
.media_type?(content_type : String | Nil, expected : String) : Bool
Whether content_type's media type, the part before any
;parameters, is expected, compared without regard to letter case.
Instance Method Summary
- #[](key : Types::Key) : String
- #[]=(key : Types::Key, value)
- #[]?(key : Types::Key)
- #delete_uploaded_files : Nil
- #fetch_all(key : Types::Key) : Array
- #files
-
#form_params : HTTP::Params
Returns parsed URL-encoded form parameters, reusing the cached body parse.
- #has_key?(key : Types::Key) : Bool
- #json(key : Types::Key)
-
#multipart_params : Types::Params
Returns parsed multipart fields, reusing the cached body parse.
- #override_method?(key : Types::Key)
- #to_h : Types::Params
-
#url_encoded_form? : Bool
Whether the request body is URL-encoded form data.
Constructor Detail
Class Method Detail
Whether content_type's media type, the part before any ;
parameters, is expected, compared without regard to letter case.
Application/X-WWW-Form-Urlencoded; charset=utf-8 is a URL-encoded
form; application/x-www-form-urlencodedx is not.
Instance Method Detail
Deletes the tempfiles behind #files and the multipart body copy, if
the body was parsed, then empties #files. It reads only what was
already parsed, so it never parses a body itself. A file that cannot
be deleted is logged and kept for
Amber::Router::File.retry_leftover_deletions, so the rest are still
removed and the request's own error, if any, is kept.
Returns parsed URL-encoded form parameters, reusing the cached body parse.
Schema request parsing uses this after routing has inspected _method.
Returns parsed multipart fields, reusing the cached body parse.