postwoman/README.md

42 lines
1.1 KiB
Markdown
Raw Normal View History

# PostWoman
A CLI api tester and request builder, totally not born out of frustration from some other tool...
2023-06-08 12:06:40 +02:00
## Why
I'd much rather edit my test routes in my text editor as bare config files and fire them via a CLI than fumble around some GUI application.
2023-06-21 23:19:52 +02:00
# Usage
`postwoman` expects a `postwoman.toml` collection in your cwd. A different file or path can be specified with the global `-c` option.
2023-06-21 23:19:52 +02:00
Use `postwoman run <filter>` to send requests to all routes in current config matching given filter (regex). Use `.` as filter to run all.
2023-06-21 23:19:52 +02:00
## Examples
A collection can be super simple
2023-06-21 23:19:52 +02:00
```toml
[route.test]
url = "https://api.alemi.dev/debug"
2023-06-21 23:19:52 +02:00
```
But more complex options are available
2023-06-21 23:19:52 +02:00
```toml
[client]
user_agent = "api-tester@alemi.dev"
2023-06-21 23:19:52 +02:00
[route.debug]
url = "https://api.alemi.dev/debug"
method = "PUT"
headers = ["Content-Type: application/json"]
body = { hello = "world!", success = true }
extract = { type = "body" }
2023-06-21 23:19:52 +02:00
[route.cookie]
url = "https://api.alemi.dev/getcookie"
method = "GET"
headers = [
"Authorization: Basic ...",
"Accept: application/json"
]
extract = { type = "header", key = "Set-Cookie" }
2023-06-21 23:19:52 +02:00
```