[docs] clarify the raised exception (#19308)
* [docs] clarify the raised exception Lest developers wanna know what the exception is. * Apply suggestions from @konsumlamm Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
This commit is contained in:
parent
53e1d57419
commit
bbd5086bc3
1 changed files with 4 additions and 4 deletions
|
|
@ -151,10 +151,10 @@ func encodeQuery*(query: openArray[(string, string)], usePlus = true,
|
||||||
result.add(encodeUrl(val, usePlus))
|
result.add(encodeUrl(val, usePlus))
|
||||||
|
|
||||||
iterator decodeQuery*(data: string): tuple[key, value: string] =
|
iterator decodeQuery*(data: string): tuple[key, value: string] =
|
||||||
## Reads and decodes query string `data` and yields the `(key, value)` pairs
|
## Reads and decodes the query string `data` and yields the `(key, value)` pairs
|
||||||
## the data consists of. If compiled with `-d:nimLegacyParseQueryStrict`, an
|
## the data consists of. If compiled with `-d:nimLegacyParseQueryStrict`,
|
||||||
## error is raised when there is an unencoded `=` character in a decoded
|
## a `UriParseError` is raised when there is an unencoded `=` character in a decoded
|
||||||
## value, which was the behavior in Nim < 1.5.1
|
## value, which was the behavior in Nim < 1.5.1.
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
import std/sequtils
|
import std/sequtils
|
||||||
assert toSeq(decodeQuery("foo=1&bar=2=3")) == @[("foo", "1"), ("bar", "2=3")]
|
assert toSeq(decodeQuery("foo=1&bar=2=3")) == @[("foo", "1"), ("bar", "2=3")]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue