74 lines
1.3 KiB
Markdown
74 lines
1.3 KiB
Markdown
# xh
|
|
|
|
## Meta
|
|
|
|
```yaml
|
|
name: xh
|
|
repo: https://github.com/ducaale/xh
|
|
description: Friendly and fast tool for sending HTTP requests
|
|
```
|
|
|
|
## Install
|
|
|
|
```shell
|
|
cargo install xh --locked
|
|
```
|
|
|
|
## Usage
|
|
|
|
### Sample #1
|
|
|
|
```shell
|
|
xh POST https://play.hatter.me/message/hook.jsonp \
|
|
'Authorization: Bearer TOKEN' \
|
|
textMessageContent=test
|
|
```
|
|
```shell
|
|
xh POST https://play.hatter.me/message/hook.jsonp \
|
|
-A bearer \
|
|
-a TOKEN \
|
|
textMessageContent=test
|
|
```
|
|
|
|
### Sample #2
|
|
```shell
|
|
curl -X POST 'https://play.hatter.me/message/hook.jsonp?token=TOKEN' \
|
|
--header 'Content-Type: application/json' \
|
|
--data '{"msgtype":"text","text":{"content":"test-message"}}'
|
|
```
|
|
```shell
|
|
xh POST 'https://play.hatter.me/message/hook.jsonp?token=TOKEN' \
|
|
Content-Type:application/json \
|
|
msgtype=text \
|
|
text:='{"content":"test-message"}'
|
|
```
|
|
```shell
|
|
xh POST 'https://play.hatter.me/message/hook.jsonp' \
|
|
Content-Type:application/json \
|
|
token==TOKEN \
|
|
msgtype=text \
|
|
'text[content]=test-message'
|
|
```
|
|
|
|
### Sample #3
|
|
```shell
|
|
xh POST https://hatter.ink/util/print_request.action \
|
|
x-header-name:test-value \
|
|
a=b \
|
|
b:=1 \
|
|
c:='[1,2,3]' \
|
|
d:='{"name":111}' \
|
|
'd[name2]=222' \
|
|
param==p1
|
|
```
|
|
```json
|
|
{
|
|
"a": "b",
|
|
"b": 1,
|
|
"c": [ 1, 2, 3 ],
|
|
"d": {
|
|
"name": 111,
|
|
"name2": "222"
|
|
}
|
|
}
|
|
``` |