📝 Add usage examples and samples to CHEATSHEET.md
This commit is contained in:
@@ -7,3 +7,48 @@ name: xh
|
|||||||
repo: https://github.com/ducaale/xh
|
repo: https://github.com/ducaale/xh
|
||||||
description: Friendly and fast tool for sending HTTP requests
|
description: Friendly and fast tool for sending HTTP requests
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
### Sample #1
|
||||||
|
```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 #2
|
||||||
|
```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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user