Current section
Files
Jump to
Current section
Files
README.md
# quieres
[](https://hex.pm/packages/quieres)
[](https://hexdocs.pm/quieres/)
<img src="https://tangled.org/ollie.earth/quieres/raw/main/public/quieres.png" alt="dog with a blunt. asking 'quieres'" width="200" height="200">
## Example
```sh
gleam add quieres@1
```
```gleam
let assert Ok(req) = request.to("https://page.example/")
req
|> request.set_method(http.Get)
|> request.set_query(
[
quieres.int("pk", 73),
quieres.float("pi", 3.14159),
quieres.optional(quieres.string, "package", option.Some("quieres")),
quieres.optional(quieres.bool, "is-cool", option.Some(True)),
quieres.optional(quieres.int, "im-not-going", option.None),
]
|> quieres.format(),
)
|> httpc.send
```
Here, `set_query` gets the following:
```gleam
[
#("pk", "73"),
#("pi", "3.14159"),
#("package", "quieres"),
#("is-cool", "True"),
]
```
Note that `im-not-going` doesn't show up at all.
Further documentation can be found at <https://hexdocs.pm/quieres>.