Skip to content

Commit

Permalink
xh: add highlighting variables
Browse files Browse the repository at this point in the history
  • Loading branch information
gbaranski authored and sbrl committed Apr 19, 2021
1 parent 72dabb9 commit f1f15b2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pages/common/xh.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}}`

0 comments on commit f1f15b2

Please sign in to comment.