diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 32 |
1 files changed, 32 insertions, 0 deletions
| @@ -6,6 +6,38 @@ Hepi is a command-line tool for testing REST APIs using YAML-based configuration | |||
| 6 | go install github.com/mitjafelicijan/hepi@latest | 6 | go install github.com/mitjafelicijan/hepi@latest |
| 7 | ``` | 7 | ``` |
| 8 | 8 | ||
| 9 | ## Basic example | ||
| 10 | |||
| 11 | ```yaml | ||
| 12 | environments: | ||
| 13 | local: | ||
| 14 | host: http://localhost:8080 | ||
| 15 | |||
| 16 | requests: | ||
| 17 | login: | ||
| 18 | method: POST | ||
| 19 | url: "{{host}}/v1/auth/login" | ||
| 20 | description: "Authenticate and get a token" | ||
| 21 | headers: | ||
| 22 | Content-Type: "application/json" | ||
| 23 | json: | ||
| 24 | username: "admin" | ||
| 25 | password: "secret-password" | ||
| 26 | |||
| 27 | get_profile: | ||
| 28 | method: GET | ||
| 29 | url: "{{host}}/v1/profile" | ||
| 30 | description: "Fetch user profile using the token from login" | ||
| 31 | headers: | ||
| 32 | Authorization: "Bearer {{login.token}}" | ||
| 33 | Accept: "application/json" | ||
| 34 | |||
| 35 | groups: | ||
| 36 | auth_flow: | ||
| 37 | - login | ||
| 38 | - get_profile | ||
| 39 | ``` | ||
| 40 | |||
| 9 | ## CLI Usage | 41 | ## CLI Usage |
| 10 | 42 | ||
| 11 | ### Basic Usage | 43 | ### Basic Usage |
