Skip to content

Commit 9817ece

Browse files
authored
xh: refresh page and add examples (#16504)
1 parent 40c17ac commit 9817ece

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

pages/common/xh.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,30 @@
55
> See also: `http`, `curl`.
66
> More information: <https://github.com/ducaale/xh>.
77
8-
- Send a GET request:
8+
- Send a GET request (shows response headers and content):
99

10-
`xh {{httpbin.org/get}}`
10+
`xh {{https://postman-echo.com/get}}`
1111

1212
- Send a POST request with a JSON body (key-value pairs are added to a top-level JSON object - e.g. `{"name": "john", "age": 25}`):
1313

14-
`xh post {{httpbin.org/post}} {{name=john}} {{age:=25}}`
14+
`xh post {{https://postman-echo.com/post}} {{name=john}} {{age=25}}`
1515

16-
- Send a GET request with query parameters (e.g. `first_param=5&second_param=true`):
16+
- Send a GET request with query parameters (e.g. `https://postman-echo.com/response-headers?foo1=bar1&foo2=bar2`):
1717

18-
`xh get {{httpbin.org/get}} {{first_param==5}} {{second_param==true}}`
18+
`xh get {{https://postman-echo.com/response-headers}} {{foo1==bar1}} {{foo2==bar2}}`
1919

2020
- Send a GET request with a custom header:
2121

22-
`xh get {{httpbin.org/get}} {{header-name:header-value}}`
22+
`xh get {{https://postman-echo.com}} {{header-name:header-value}}`
2323

2424
- Make a GET request and save the response body to a file:
2525

26-
`xh --download {{httpbin.org/json}} --output {{path/to/file}}`
26+
`xh {{[-d|--download]}} {{https://example.com}} {{[-o|--output]}} {{path/to/file}}`
27+
28+
- Construct a request but do not send it (similar to a dry-run):
29+
30+
`xh --offline {{get|delete|...}} {{https://example.com}}`
2731

2832
- Show equivalent `curl` command (this will not send any request):
2933

30-
`xh --{{curl|curl-long}} {{--follow --verbose get http://example.com user-agent:curl}}`
34+
`xh --{{curl|curl-long}} {{--follow --verbose get https://example.com user-agent:curl}}`

0 commit comments

Comments
 (0)