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-05 14:11:13 +01:00
|
|
|
- Send a POST request with JSON body: `{"name": "ahmed", "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-05 14:11:13 +01:00
|
|
|
- Send a GET request with querystring id=5&sort=true:
|
2021-04-05 14:01:13 +01:00
|
|
|
|
2021-04-05 14:08:16 +01:00
|
|
|
`xh get {{httpbin.org/get}} {{id==5}} {{sort==true}}`
|
2021-04-05 14:01:13 +01:00
|
|
|
|
2021-04-05 14:11:13 +01:00
|
|
|
- Send a GET request and include a header named x-api-key with value 12345:
|
2021-04-05 14:01:13 +01:00
|
|
|
|
2021-04-05 14:08:16 +01:00
|
|
|
`xh get {{httpbin.org/get}} {{x-api-key:12345}}`
|
2021-04-05 14:01:13 +01:00
|
|
|
|
2021-04-05 14:11:13 +01:00
|
|
|
- Send a PUT request and pipe the result to less:
|
2021-04-05 14:01:13 +01:00
|
|
|
|
2021-04-05 14:08:16 +01:00
|
|
|
`xh put {{httpbin.org/put}} {{id:=49}} {{age:=25}} | less`
|
2021-04-05 14:01:13 +01:00
|
|
|
|
2021-04-05 14:11:13 +01:00
|
|
|
- Download and save to res.json:
|
2021-04-05 14:01:13 +01:00
|
|
|
|
2021-04-05 14:08:16 +01:00
|
|
|
`xh -d {{httpbin.org/json}} -o {{res.json}}`
|