1HTTPS(1) User Commands HTTPS(1)
2
3
4
6 https - manual page for https 2.6.0
7
9 usage: http [--json] [--form] [--multipart] [--boundary BOUNDARY]
10 [--raw RAW]
11
12 [--compress] [--pretty {all,colors,format,none}] [--style STYLE]
13 [--unsorted] [--sorted] [--response-charset ENCODING] [--re‐
14 sponse-mime MIME_TYPE] [--format-options FORMAT_OPTIONS]
15 [--print WHAT] [--headers] [--body] [--verbose] [--all] [--his‐
16 tory-print WHAT] [--stream] [--output FILE] [--download] [--con‐
17 tinue] [--quiet] [--session SESSION_NAME_OR_PATH | --ses‐
18 sion-read-only SESSION_NAME_OR_PATH] [--auth USER[:PASS]]
19 [--auth-type {basic,digest}] [--ignore-netrc] [--offline]
20 [--proxy PROTOCOL:PROXY_URL] [--follow] [--max-redirects
21 MAX_REDIRECTS] [--max-headers MAX_HEADERS] [--timeout SECONDS]
22 [--check-status] [--path-as-is] [--chunked] [--verify VERIFY]
23 [--ssl {ssl2.3,tls1,tls1.1,tls1.2}] [--ciphers CIPHERS] [--cert
24 CERT] [--cert-key CERT_KEY] [--ignore-stdin] [--help] [--ver‐
25 sion] [--traceback] [--default-scheme DEFAULT_SCHEME] [--debug]
26 [METHOD] URL [REQUEST_ITEM ...]
27
28 HTTPie: command-line HTTP client for the API era. <https://httpie.io>
29
30 Positional Arguments:
31
32 These arguments come after any flags and in the order they are
33 listed here. Only URL is required.
34
35 METHOD
36
37 The HTTP method to be used for the request (GET, POST, PUT,
38 DELETE, ...).
39
40 This argument can be omitted in which case HTTPie will use POST
41 if there is some data to be sent, otherwise GET:
42
43 $ http example.org # => GET
44 $ http example.org hello=world # => POST
45
46 URL
47
48 The scheme defaults to 'http://' if the URL does not include
49 one. (You can override this with: --default-scheme=https)
50
51 You can also use a shorthand for localhost
52
53 $ http :3000 # => http://localhost:3000
54 $ http :/foo # => http://localhost/foo
55
56 REQUEST_ITEM
57
58 Optional key-value pairs to be included in the request. The sep‐
59 arator used determines the type:
60
61 ':' HTTP headers:
62
63 Referer:https://httpie.io
64 Cookie:foo=bar User-Agent:bacon/1.0
65
66 '==' URL parameters to be appended to the request URI:
67
68 search==httpie
69
70 '=' Data fields to be serialized into a JSON object (with
71 --json, -j)
72
73 or form data (with --form, -f):
74
75 name=HTTPie
76 language=Python description='CLI HTTP client'
77
78 ':=' Non-string JSON data fields (only with --json, -j):
79
80 awesome:=true
81 amount:=42 colors:='["red", "green", "blue"]'
82
83 '@' Form file fields (only with --form or --multipart):
84
85 cv@~/Documents/CV.pdf cv@'~/Documents/CV.pdf;type=applica‐
86 tion/pdf'
87
88 '=@' A data field like '=', but takes a file path and embeds its
89 content:
90
91 essay=@Documents/essay.txt
92
93 ':=@' A raw JSON field like ':=', but takes a file path and em‐
94 beds its content:
95
96 package:=@./package.json
97
98 You can use a backslash to escape a colliding separator in the
99 field name:
100
101 field-name-with\:colon=value
102
103 Predefined Content Types:
104 --json, -j
105
106 (default) Data items from the command line are serialized as a
107 JSON object. The Content-Type and Accept headers are set to ap‐
108 plication/json (if not specified).
109
110 --form, -f
111
112 Data items from the command line are serialized as form fields.
113
114 The Content-Type is set to application/x-www-form-urlencoded (if
115 not specified). The presence of any file fields results in a
116 multipart/form-data request.
117
118 --multipart
119
120 Similar to --form, but always sends a multipart/form-data re‐
121 quest (i.e., even without files).
122
123 --boundary BOUNDARY
124
125 Specify a custom boundary string for multipart/form-data re‐
126 quests. Only has effect only together with --form.
127
128 --raw RAW
129
130 This option allows you to pass raw request data without extra
131 processing (as opposed to the structured request items syntax):
132
133 $ http --raw='data' pie.dev/post
134
135 You can achieve the same by piping the data via stdin:
136
137 $ echo data | http pie.dev/post
138
139 Or have HTTPie load the raw data from a file:
140
141 $ http pie.dev/post @data.txt
142
143 Content Processing Options:
144 --compress, -x
145
146 Content compressed (encoded) with Deflate algorithm. The Con‐
147 tent-Encoding header is set to deflate.
148
149 Compression is skipped if it appears that compression ratio is
150 negative. Compression can be forced by repeating the argument.
151
152 Output Processing:
153 --pretty {all,colors,format,none}
154
155 Controls output processing. The value can be "none" to not pret‐
156 tify the output (default for redirected output), "all" to apply
157 both colors and formatting (default for terminal output), "col‐
158 ors", or "format".
159
160 --style STYLE, -s STYLE
161
162 Output coloring style (default is "auto"). It can be One of:
163
164 abap, algol, algol_nu, arduino, auto, autumn, borland, bw, col‐
165 orful, default, emacs, friendly, fruity, gruvbox-dark, gru‐
166 vbox-light, igor, inkpot, lovelace, manni, material, monokai,
167 murphy, native, paraiso-dark, paraiso-light, pastie, perldoc,
168 rainbow_dash, rrt, sas, solarized, solarized-dark, solar‐
169 ized-light, stata, stata-dark, statalight, tango, trac, vim, vs,
170 xcode, zenburn
171
172 The "auto" style follows your terminal's ANSI color styles.
173
174 For non-auto styles to work properly, please make sure that the
175 $TERM environment variable is set to "xterm-256color" or similar
176 (e.g., via `export TERM=xterm-256color' in your ~/.bashrc).
177
178 --unsorted
179
180 Disables all sorting while formatting output. It is a shortcut
181 for:
182
183 --format-options=headers.sort:false,json.sort_keys:false
184
185 --sorted
186
187 Re-enables all sorting options while formatting output. It is a
188 shortcut for:
189
190 --format-options=headers.sort:true,json.sort_keys:true
191
192 --response-charset ENCODING
193
194 Override the response encoding for terminal display purposes,
195 e.g.:
196
197 --response-charset=utf8
198
199 --response-charset=big5
200
201 --response-mime MIME_TYPE
202
203 Override the response mime type for coloring and formatting for
204 the terminal, e.g.:
205
206 --response-mime=application/json
207
208 --response-mime=text/xml
209
210 --format-options FORMAT_OPTIONS
211
212 Controls output formatting. Only relevant when formatting is en‐
213 abled through (explicit or implied) --pretty=all or
214 --pretty=format. The following are the default options:
215
216 headers.sort:true json.format:true json.indent:4
217 json.sort_keys:true xml.format:true xml.indent:2
218
219 You may use this option multiple times, as well as specify mul‐
220 tiple comma-separated options at the same time. For example,
221 this modifies the settings to disable the sorting of JSON keys,
222 and sets the indent size to 2:
223
224 --format-options json.sort_keys:false,json.indent:2
225
226 This is something you will typically put into your config file.
227
228 Output Options:
229 --print WHAT, -p WHAT
230
231 String specifying what the output should contain:
232
233 'H' request headers 'B' request body 'h' response headers 'b'
234 response body
235
236 The default behaviour is 'hb' (i.e., the response headers and
237 body is printed), if standard output is not redirected. If the
238 output is piped to another program or to a file, then only the
239 response body is printed by default.
240
241 --headers, -h
242
243 Print only the response headers. Shortcut for --print=h.
244
245 --body, -b
246
247 Print only the response body. Shortcut for --print=b.
248
249 --verbose, -v
250
251 Verbose output. Print the whole request as well as the response.
252 Also print any intermediary requests/responses (such as redi‐
253 rects). It's a shortcut for: --all --print=BhHb
254
255 --all
256
257 By default, only the final request/response is shown. Use this
258 flag to show any intermediary requests/responses as well. Inter‐
259 mediary requests include followed redirects (with --follow), the
260 first unauthorized request when Digest auth is used (--auth=di‐
261 gest), etc.
262
263 --history-print WHAT, -P WHAT
264
265 The same as --print, -p but applies only to intermediary re‐
266 quests/responses (such as redirects) when their inclusion is en‐
267 abled with --all. If this options is not specified, then they
268 are formatted the same way as the final response.
269
270 --stream, -S
271
272 Always stream the response body by line, i.e., behave like `tail
273 -f'.
274
275 Without --stream and with --pretty (either set or implied),
276 HTTPie fetches the whole response before it outputs the pro‐
277 cessed data.
278
279 Set this option when you want to continuously display a pretti‐
280 fied long-lived response, such as one from the Twitter streaming
281 API.
282
283 It is useful also without --pretty: It ensures that the output
284 is flushed more often and in smaller chunks.
285
286 --output FILE, -o FILE
287
288 Save output to FILE instead of stdout. If --download is also
289 set, then only the response body is saved to FILE. Other parts
290 of the HTTP exchange are printed to stderr.
291
292 --download, -d
293
294 Do not print the response body to stdout. Rather, download it
295 and store it in a file. The filename is guessed unless specified
296 with --output [filename]. This action is similar to the default
297 behaviour of wget.
298
299 --continue, -c
300
301 Resume an interrupted download. Note that the --output option
302 needs to be specified as well.
303
304 --quiet, -q
305
306 Do not print to stdout or stderr, except for errors and warnings
307 when provided once. Provide twice to suppress warnings as well.
308 stdout is still redirected if --output is specified. Flag
309 doesn't affect behaviour of download beyond not printing to ter‐
310 minal.
311
312 Sessions:
313 --session SESSION_NAME_OR_PATH
314
315 Create, or reuse and update a session. Within a session, custom
316 headers, auth credential, as well as any cookies sent by the
317 server persist between requests.
318
319 Session files are stored in:
320
321 /builddir/.config/httpie/sessions/<HOST>/<SESSION_NAME>.json.
322
323 --session-read-only SESSION_NAME_OR_PATH
324
325 Create or read a session without updating it form the re‐
326 quest/response exchange.
327
328 Authentication:
329 --auth USER[:PASS], -a USER[:PASS]
330
331 If only the username is provided (-a username), HTTPie will
332 prompt for the password.
333
334 --auth-type {basic,digest}, -A {basic,digest}
335
336 The authentication mechanism to be used. Defaults to "basic".
337
338 "basic": Basic HTTP auth "digest": Digest HTTP auth
339
340 --ignore-netrc
341
342 Ignore credentials from .netrc.
343
344 Network:
345 --offline
346
347 Build the request and print it but donâ.t actually send it.
348
349 --proxy PROTOCOL:PROXY_URL
350
351 String mapping protocol to the URL of the proxy (e.g.
352 http:http://foo.bar:3128). You can specify multiple proxies with
353 different protocols. The environment variables $ALL_PROXY,
354 $HTTP_PROXY, and $HTTPS_proxy are supported as well.
355
356 --follow, -F
357
358 Follow 30x Location redirects.
359
360 --max-redirects MAX_REDIRECTS
361
362 By default, requests have a limit of 30 redirects (works with
363 --follow).
364
365 --max-headers MAX_HEADERS
366
367 The maximum number of response headers to be read before giving
368 up (default 0, i.e., no limit).
369
370 --timeout SECONDS
371
372 The connection timeout of the request in seconds. The default
373 value is 0, i.e., there is no timeout limit. This is not a time
374 limit on the entire response download; rather, an error is re‐
375 ported if the server has not issued a response for timeout sec‐
376 onds (more precisely, if no bytes have been received on the un‐
377 derlying socket for timeout seconds).
378
379 --check-status
380
381 By default, HTTPie exits with 0 when no network or other fatal
382 errors occur. This flag instructs HTTPie to also check the HTTP
383 status code and exit with an error if the status indicates one.
384
385 When the server replies with a 4xx (Client Error) or 5xx (Server
386 Error) status code, HTTPie exits with 4 or 5 respectively. If
387 the response is a 3xx (Redirect) and --follow hasn't been set,
388 then the exit status is 3. Also an error message is written to
389 stderr if stdout is redirected.
390
391 --path-as-is
392
393 Bypass dot segment (/../ or /./) URL squashing.
394
395 --chunked
396
397 Enable streaming via chunked transfer encoding. The Trans‐
398 fer-Encoding header is set to chunked.
399
400 SSL:
401 --verify VERIFY
402
403 Set to "no" (or "false") to skip checking the host's SSL cer‐
404 tificate. Defaults to "yes" ("true"). You can also pass the
405 path to a CA_BUNDLE file for private certs. (Or you can set the
406 REQUESTS_CA_BUNDLE environment variable instead.)
407
408 --ssl {ssl2.3,tls1,tls1.1,tls1.2}
409
410 The desired protocol version to use. This will default to SSL
411 v2.3 which will negotiate the highest protocol that both the
412 server and your installation of OpenSSL support. Available pro‐
413 tocols may vary depending on OpenSSL installation (only the sup‐
414 ported ones are shown here).
415
416 --ciphers CIPHERS
417
418 A string in the OpenSSL cipher list format. By default, the fol‐
419 lowing is used:
420
421 ECDHE+AESGCM:ECDHE+CHACHA20:DHE+AESGCM:DHE+CHACHA20:ECDH+AES‐
422 GCM:DH+AESGCM:ECDH+AES:DH+AES:RSA+AESGCM:RSA+AES:!aN‐
423 ULL:!eNULL:!MD5:!DSS
424
425 --cert CERT
426
427 You can specify a local cert to use as client side SSL certifi‐
428 cate. This file may either contain both private key and cer‐
429 tificate or you may specify --cert-key separately.
430
431 --cert-key CERT_KEY
432
433 The private key to use with SSL. Only needed if --cert is given
434 and the certificate file does not contain the private key.
435
436 Troubleshooting:
437 --ignore-stdin, -I
438
439 Do not attempt to read stdin.
440
441 --help
442
443 Show this help message and exit.
444
445 --version
446
447 Show version and exit.
448
449 --traceback
450
451 Prints the exception traceback should one occur.
452
453 --default-scheme DEFAULT_SCHEME
454
455 The default scheme to use if not specified in the URL.
456
457 --debug
458
459 Prints the exception traceback should one occur, as well as
460 other information useful for debugging HTTPie itself and for re‐
461 porting bugs.
462
463 For every --OPTION there is also a --no-OPTION that reverts OPTION to
464 its default value.
465
466 Suggestions and bug reports are greatly appreciated:
467
468 https://github.com/httpie/httpie/issues
469
471 The full documentation for https is maintained as a Texinfo manual. If
472 the info and https programs are properly installed at your site, the
473 command
474
475 info https
476
477 should give you access to the complete manual.
478
479
480
481https 2.6.0 October 2021 HTTPS(1)