-
Notifications
You must be signed in to change notification settings - Fork 102
/
Copy pathxh.1
281 lines (281 loc) · 7.36 KB
/
xh.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13.
.TH XH "1" "May 2022" "xh 0.16.1" "User Commands"
.SH NAME
xh \- Friendly and fast tool for sending HTTP requests
.SH SYNOPSIS
.B xh
[\fI\,OPTIONS\/\fR] \fI\,<\/\fR[\fI\,METHOD\/\fR] \fI\,URL> \/\fR[\fI\,--\/\fR] [\fI\,REQUEST_ITEM\/\fR]...
.SH DESCRIPTION
xh is a friendly and fast tool for sending HTTP requests.
.PP
It reimplements as much as possible of HTTPie's excellent design, with a focus on improved
performance.
.SH OPTIONS
.SS "Positional Arguments"
.HP
METHOD
.IP
The HTTP method to use. One of \fBget\fR, \fBpost\fR, \fBhead\fR, \fBput\fR, \fBpatch\fR, \fBdelete\fR, or \fBoptions\fR.
.IP
Optional. If omitted, a GET or a POST will be done depending on whether the request sends data.
.HP
URL
.IP
The URL to request. The scheme defaults to 'http://' unless \fB\-\-https\fR is used.
.IP
A leading colon works as shorthand for localhost. :8000 is equivalent to localhost:8000, and :/path is equivalent to localhost/path.
.HP
REQUEST_ITEM...
.IP
Optional key-value pairs to be included in the request.
.IP
\fBkey==value\fR to add a parameter to the URL
.IP
\fBkey=value\fR to add a JSON field (\fB\-\-json\fR) or form field (\fB\-\-form\fR)
.IP
\fBkey=@value\fR to add a JSON field (\fB\-\-json\fR) or form field (\fB\-\-form\fR) from a file.
.IP
\fBkey:=value\fR to add a complex JSON value (e.g. `numbers:=[1,2,3]`)
.IP
\fBkey:=@value\fR to add a complex JSON value (e.g. `numbers:=@data.json`) from a file.
.IP
\fBkey@filename\fR to upload a file from filename (with \fB\-\-form\fR)
.IP
\fB@filename\fR to use a file as the request body
.IP
\fBheader:value\fR to add a header
.IP
\fBheader:\fR to unset a header
.IP
\fBheader;\fR to add a header with an empty value
.IP
A backslash can be used to escape special characters (e.g. weird\\:key=value).
.IP
File uploads can take ';type=' and ';filename=' parameters to set the mimetype and filename, respectively. For example:
.IP
key@filename;type=text/html;filename=document.html
.SS "Options"
.HP
\fB\-j\fR, \fB\-\-json\fR
.IP
(default) Serialize data items from the command line as a JSON object
.HP
\fB\-f\fR, \fB\-\-form\fR
.IP
Serialize data items from the command line as form fields
.HP
\fB\-m\fR, \fB\-\-multipart\fR
.IP
Like \fB\-\-form\fR, but force a multipart/form\-data request even without files
.HP
\fB\-\-raw\fR <RAW>
.IP
Pass raw request data without extra processing
.HP
\fB\-\-pretty\fR <STYLE>
.IP
Controls output processing
.IP
[possible values: all, colors, format, none]
.HP
\fB\-s\fR, \fB\-\-style\fR <THEME>
.IP
Output coloring style
.IP
[possible values: auto, solarized, monokai, fruity]
.HP
\fB\-\-response\-charset\fR <ENCODING>
.IP
Override the response encoding for terminal display purposes.
.IP
Example: `\-\-response\-charset=latin1`
.HP
\fB\-\-response\-mime\fR <MIME_TYPE>
.IP
Override the response mime type for coloring and formatting for the terminal
.IP
Example: `\-\-response\-mime=application/json`
.HP
\fB\-p\fR, \fB\-\-print\fR <FORMAT>
.IP
String specifying what the output should contain.
.IP
Use `H` and `B` for request header and body respectively, and `h` and `b` for response
hader and body.
.IP
Example: `\-\-print=Hb`
.HP
\fB\-h\fR, \fB\-\-headers\fR
.IP
Print only the response headers. Shortcut for \fB\-\-print\fR=\fI\,h\/\fR
.HP
\fB\-b\fR, \fB\-\-body\fR
.IP
Print only the response body. Shortcut for \fB\-\-print\fR=\fI\,b\/\fR
.HP
\fB\-v\fR, \fB\-\-verbose\fR
.IP
Print the whole request as well as the response
.HP
\fB\-\-all\fR
.IP
Show any intermediary requests/responses while following redirects with \fB\-\-follow\fR
.HP
\fB\-P\fR, \fB\-\-history\-print\fR <FORMAT>
.IP
The same as \fB\-\-print\fR but applies only to intermediary requests/responses
.HP
\fB\-q\fR, \fB\-\-quiet\fR
.IP
Do not print to stdout or stderr
.HP
\fB\-S\fR, \fB\-\-stream\fR
.IP
Always stream the response body
.HP
\fB\-o\fR, \fB\-\-output\fR <FILE>
.IP
Save output to FILE instead of stdout
.HP
\fB\-d\fR, \fB\-\-download\fR
.IP
Download the body to a file instead of printing it
.HP
\fB\-c\fR, \fB\-\-continue\fR
.IP
Resume an interrupted download. Requires \fB\-\-download\fR and \fB\-\-output\fR
.HP
\fB\-\-session\fR <FILE>
.IP
Create, or reuse and update a session.
.IP
Within a session, custom headers, auth credentials, as well as any cookies sent by the
server persist between requests.
.HP
\fB\-\-session\-read\-only\fR <FILE>
.IP
Create or read a session without updating it form the request/response exchange
.HP
\fB\-A\fR, \fB\-\-auth\-type\fR <AUTH_TYPE>
.IP
Specify the auth mechanism
.IP
[possible values: basic, bearer, digest]
.HP
\fB\-a\fR, \fB\-\-auth\fR <USER[:PASS] | TOKEN>
.IP
Authenticate as USER with PASS or with TOKEN.
.IP
PASS will be prompted if missing. Use a trailing colon (i.e. `USER:`) to authenticate
with just a username.
.IP
TOKEN is expected if `\-\-auth\-type=bearer`.
.HP
\fB\-\-ignore\-netrc\fR
.IP
Do not use credentials from .netrc
.HP
\fB\-\-offline\fR
.IP
Construct HTTP requests without sending them anywhere
.HP
\fB\-\-check\-status\fR
.IP
(default) Exit with an error status code if the server replies with an error.
.IP
The exit code will be 4 on 4xx (Client Error), 5 on 5xx (Server Error), or 3 on 3xx
(Redirect) if \fB\-\-follow\fR isn't set.
.IP
If stdout is redirected then a warning is written to stderr.
.HP
\fB\-F\fR, \fB\-\-follow\fR
.IP
Do follow redirects
.HP
\fB\-\-max\-redirects\fR <NUM>
.IP
Number of redirects to follow, only respected if `follow` is set
.HP
\fB\-\-timeout\fR <SEC>
.IP
Connection timeout of the request.
.IP
The default value is `0`, i.e., there is no timeout limit.
.HP
\fB\-\-proxy\fR <PROTOCOL:URL>
.IP
Use a proxy for a protocol. For example: `\-\-proxy https:http://proxy.host:8080`.
.IP
PROTOCOL can be `http`, `https` or `all`.
.IP
If your proxy requires credentials, put them in the URL, like so: `\-\-proxy
http:socks5://user:password@proxy.host:8000`.
.IP
You can specify proxies for multiple protocols by repeating this option.
.IP
The environment variables `http_proxy` and `https_proxy` can also be used, but are
completely ignored if \fB\-\-proxy\fR is passed.
.HP
\fB\-\-verify\fR <VERIFY>
.IP
If "no", skip SSL verification. If a file path, use it as a CA bundle.
.IP
Specifying a CA bundle will disable the system's built\-in root certificates.
.IP
"false" instead of "no" also works. The default is "yes" ("true").
.HP
\fB\-\-cert\fR <FILE>
.IP
Use a client side certificate for SSL
.HP
\fB\-\-cert\-key\fR <FILE>
.IP
A private key file to use with \fB\-\-cert\fR.
.IP
Only necessary if the private key is not contained in the cert file.
.HP
\fB\-\-ssl\fR <VERSION>
.IP
Force a particular TLS version.
.IP
"auto" gives the default behavior of negotiating a version with the server.
.IP
[possible values: auto, tls1, tls1.1, tls1.2, tls1.3]
.HP
\fB\-\-native\-tls\fR
.IP
Use the system TLS library instead of rustls (if enabled at compile time)
.HP
\fB\-\-https\fR
.IP
Make HTTPS requests if not specified in the URL
.HP
\fB\-\-http\-version\fR <VERSION>
.IP
HTTP version to use
.IP
[possible values: 1.0, 1.1, 2]
.HP
\fB\-I\fR, \fB\-\-ignore\-stdin\fR
.IP
Do not attempt to read stdin
.HP
\fB\-\-curl\fR
.IP
Print a translation to a `curl` command.
.IP
For translating the other way, try https://curl2httpie.online/.
.HP
\fB\-\-curl\-long\fR
.IP
Use the long versions of curl's flags
.HP
\fB\-\-help\fR
.IP
Print help information
.HP
\fB\-V\fR, \fB\-\-version\fR
.IP
Print version information
.PP
Each option can be reset with a \fB\-\-no\-OPTION\fR argument.