1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-22 01:02:09 +02:00

xh: add highlighting variables

This commit is contained in:
Grzegorz Baranski 2021-04-05 15:08:16 +02:00 committed by Starbeamrainbowlabs
parent 72dabb9f73
commit f1f15b255b

View file

@ -5,24 +5,24 @@
- Send a GET request
`xh httpbin.org/get`
`xh {{httpbin.org/get}}`
- Send a POST request with JSON body: `{"name": "ahmed", "age": 25}`
`xh post httpbin.org/post name=john age:=25`
`xh post {{httpbin.org/post}} {{name=john}} {{age:=25}}`
- Send a GET request with querystring id=5&sort=true
`xh get httpbin.org/get id==5 sort==true`
`xh get {{httpbin.org/get}} {{id==5}} {{sort==true}}`
- Send a GET request and include a header named x-api-key with value 12345
`xh get httpbin.org/get x-api-key:12345`
`xh get {{httpbin.org/get}} {{x-api-key:12345}}`
- Send a PUT request and pipe the result to less
`xh put httpbin.org/put id:=49 age:=25 | less`
`xh put {{httpbin.org/put}} {{id:=49}} {{age:=25}} | less`
- Download and save to res.json
`xh -d httpbin.org/json -o res.json`
`xh -d {{httpbin.org/json}} -o {{res.json}}`