2021-04-05 14:01:13 +01:00
|
|
|
# xh
|
|
|
|
|
2021-04-05 14:37:44 +01:00
|
|
|
> Friendly and fast tool for sending HTTP requests.
|
2021-04-05 14:01:13 +01:00
|
|
|
> More information: <https://github.com/ducaale/xh>.
|
|
|
|
|
2021-04-05 14:11:13 +01:00
|
|
|
- Send a GET request:
|
2021-04-05 14:01:13 +01:00
|
|
|
|
2021-04-05 14:08:16 +01:00
|
|
|
`xh {{httpbin.org/get}}`
|
2021-04-05 14:01:13 +01:00
|
|
|
|
2021-04-11 15:28:23 +01:00
|
|
|
- Send a POST request with a JSON body (key-value pairs are added to a top-level JSON object - e.g. `{"name": "john", "age": 25}`):
|
2021-04-05 14:01:13 +01:00
|
|
|
|
2021-04-05 14:08:16 +01:00
|
|
|
`xh post {{httpbin.org/post}} {{name=john}} {{age:=25}}`
|
2021-04-05 14:01:13 +01:00
|
|
|
|
2021-04-11 15:43:44 +01:00
|
|
|
- Send a GET request with query parameters (e.g. `first_param=5&second_param=true`):
|
2021-04-05 14:01:13 +01:00
|
|
|
|
2021-04-11 15:43:44 +01:00
|
|
|
`xh get {{httpbin.org/get}} {{first_param==5}} {{second_param==true}}`
|
2021-04-05 14:01:13 +01:00
|
|
|
|
2021-04-05 14:44:14 +01:00
|
|
|
- Send a GET request with a custom header:
|
2021-04-05 14:01:13 +01:00
|
|
|
|
2021-04-05 14:44:14 +01:00
|
|
|
`xh get {{httpbin.org/get}} {{header-name:header-value}}`
|
2021-04-05 14:01:13 +01:00
|
|
|
|
2021-04-05 14:45:04 +01:00
|
|
|
- Make a GET request and save the response body to a file:
|
2021-04-05 14:01:13 +01:00
|
|
|
|
2021-04-05 14:45:04 +01:00
|
|
|
`xh --download {{httpbin.org/json}} --output {{path/to/file}}`
|