Skip to content

Commit

Permalink
Update readme and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
mishankov committed Aug 20, 2024
1 parent 2da5d3d commit 0882af8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ Arguments:
- `query` - request query params. Example: `{"param1": "val", "param2": "val2"}`
- `encodeQueryParams` - parameters for `encodeQuery` function that encodes query params. [More](https://nim-lang.org/docs/uri.html#encodeQuery%2CopenArray%5B%5D%2Cchar)
- `body` - request body as a string. Example: `"{\"key\": \"value\"}"`. Is not available for `get`, `head` and `options` procedures
- `files` - array of files to upload. Every file is a tuple of multipart name, file name, content type and content
- `sreamingFiles` - array of files to stream from disc and upload. Every file is a tuple of multipart name and file path
- `auth` - login and password for basic authorization. Example: `("login", "password")`
- `timeout` - stop waiting for a response after a given number of milliseconds. `-1` for no timeout, which is default value
- `ignoreSsl` - no certificate verification if `true`
Expand Down
3 changes: 3 additions & 0 deletions examples/examples.nim
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ for catTag in catTags[0..4]:
echo "Response status: ", catData.status
echo "Response headers: ", catData.headers
echo "Response body: ", catData.body

# Send file
echo post("https://validator.w3.org/check", files = @[("uploaded_file", "test.html", "text/html", "<html><head></head><body><p>test</p></body></html>")]).body

0 comments on commit 0882af8

Please sign in to comment.