From 203935acbd42c3b8248bf52099afe4df6f924b51 Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Sun, 12 Apr 2026 02:01:40 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Add=20usage=20examples=20and=20s?= =?UTF-8?q?amples=20to=20CHEATSHEET.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xh/CHEATSHEET.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/xh/CHEATSHEET.md b/xh/CHEATSHEET.md index 249e955..9f0c2c5 100644 --- a/xh/CHEATSHEET.md +++ b/xh/CHEATSHEET.md @@ -7,3 +7,48 @@ name: xh repo: https://github.com/ducaale/xh 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" + } +} +``` \ No newline at end of file