Skip to content

Commit 7804b5e

Browse files
committed
Document all command line parameters in README.md
1 parent 0a6527a commit 7804b5e

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@ cargo build --release
1818

1919
```bash
2020
hammerload <PROTOCOL> --url <URL> [OPTIONS]
21+
```
2122

23+
Request options
24+
```
25+
-X, --method <METHOD> HTTP method (GET, POST…)
26+
-H, --header <HEADER> Custom headers (repeatable)
27+
-b, --body <STRING> Request body
28+
-F, --form <KEY=VALUE> Form fields (repeatable)
2229
```
2330

2431
## Examples
@@ -28,6 +35,21 @@ Benchmark an HTTP service for 10 seconds with 1 worker
2835
hammerload http -url http://localhost:8000/files/1
2936
```
3037

38+
Passing headers
39+
```bash
40+
hammerload http -u http://localhost:8000/files/1 -H "Authorization: Bearer TOKEN" -H "Content-Type: application/json"
41+
```
42+
43+
Make POST request with json body
44+
```bash
45+
hammerload http -X POST -u http://localhost:8000/files/ --duration 1 --concurrency 1 -b '{"filename": "test.txt", "directory_path": "", "file_type": "file", "checksum": "checksum", "size": 0}'
46+
```
47+
48+
Make POST request with form parameters
49+
```bash
50+
hammerload http -X POST -u http://localhost:8000/files/ --duration 1 --concurrency 1 -F "filename=test.txt" -F "file_type=file" -F "checksum=checksum" -F "size=0"
51+
```
52+
3153
Benchmark an HTTP service for 30 seconds with 200 workers
3254

3355
```bash

0 commit comments

Comments
 (0)