| 1 |
= cowboy_req:qs(3) |
| 2 |
|
| 3 |
== Name |
| 4 |
|
| 5 |
cowboy_req:qs - URI query string |
| 6 |
|
| 7 |
== Description |
| 8 |
|
| 9 |
[source,erlang] |
| 10 |
---- |
| 11 |
qs(Req :: cowboy_req:req()) -> Qs :: binary() |
| 12 |
---- |
| 13 |
|
| 14 |
Return the query string of the effective request URI. |
| 15 |
|
| 16 |
The query string can also be obtained using pattern matching: |
| 17 |
|
| 18 |
[source,erlang] |
| 19 |
---- |
| 20 |
#{qs := Qs} = Req. |
| 21 |
---- |
| 22 |
|
| 23 |
== Arguments |
| 24 |
|
| 25 |
Req:: |
| 26 |
|
| 27 |
The Req object. |
| 28 |
|
| 29 |
== Return value |
| 30 |
|
| 31 |
The query string is returned as a binary string. It is case sensitive. |
| 32 |
|
| 33 |
== Changelog |
| 34 |
|
| 35 |
* *2.0*: Only the query string is returned, it is no longer wrapped in a tuple. |
| 36 |
* *1.0*: Function introduced. |
| 37 |
|
| 38 |
== Examples |
| 39 |
|
| 40 |
.Get the effective request URI's query string |
| 41 |
[source,erlang] |
| 42 |
---- |
| 43 |
Qs = cowboy_req:qs(Req). |
| 44 |
---- |
| 45 |
|
| 46 |
== See also |
| 47 |
|
| 48 |
link:man:cowboy_req(3)[cowboy_req(3)], |
| 49 |
link:man:cowboy_req:parse_qs(3)[cowboy_req:parse_qs(3)], |
| 50 |
link:man:cowboy_req:match_qs(3)[cowboy_req:match_qs(3)] |