diff options
author | Loïc Hoguin <[email protected]> | 2016-11-07 18:03:47 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2016-11-07 18:03:47 +0200 |
commit | 7b248e5163fd852d6defe967318da849433dadb1 (patch) | |
tree | 2db5fc09210cb77e77cf14a9ac61fef932131f15 /doc/src/manual/cowboy_req.match_qs.asciidoc | |
parent | bd34dfdedd369b42b1e6920f60c32b0594802aa2 (diff) | |
download | cowboy-7b248e5163fd852d6defe967318da849433dadb1.tar.gz cowboy-7b248e5163fd852d6defe967318da849433dadb1.tar.bz2 cowboy-7b248e5163fd852d6defe967318da849433dadb1.zip |
Add man pages for the parse/match/binding cowboy_req functions
Diffstat (limited to 'doc/src/manual/cowboy_req.match_qs.asciidoc')
-rw-r--r-- | doc/src/manual/cowboy_req.match_qs.asciidoc | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/doc/src/manual/cowboy_req.match_qs.asciidoc b/doc/src/manual/cowboy_req.match_qs.asciidoc index e66d311..845d09a 100644 --- a/doc/src/manual/cowboy_req.match_qs.asciidoc +++ b/doc/src/manual/cowboy_req.match_qs.asciidoc @@ -15,10 +15,20 @@ match_qs(Fields :: cowboy:fields(), Req :: cowboy_req:req()) Parse the query string and match specific values against constraints. -This function allows easily retrieving expected values -from the query string, validating and converting them -in one call. In addition, the keys are converted to -atoms, making manipulation that much simpler. +Cowboy will only return the query string values specified +in the fields list, and ignore all others. Fields can be +either the key requested; the key along with a list of +constraints; or the key, a list of constraints and a +default value in case the key is missing. + +This function will crash if the key is missing and no +default value is provided. This function will also crash +if a constraint fails. + +The key must be provided as an atom. The key of the +returned map will be that atom. The value may be converted +through the use of constraints, making this function able +to extract, validate and convert values all in one step. == Arguments |