1.4 KiB
1.4 KiB
title | category | layout | weight | updated |
---|---|---|---|---|
httpie | CLI | 2017/sheet | -3 | 2017-09-04 |
Parameters
$ http POST example.com/posts/3 \
Origin:example.com \ # : HTTP headers
name="John Doe" \ # = string
q=="search" \ # == URL parameters (?q=search)
age:=29 \ # := for non-strings
list:='[1,3,4]' # := json
file@file.bin \ # @ attach file
token=@token.txt \ # =@ read from file (text)
user:=@user.json # :=@ read from file (json)
Forms
$ http --form POST example.com \
name="John Smith" \
cv=@document.txt
Options
Print options: {: .-setup}
-v, --verbose # same as --print=HhBb
--print=HhBb # H: request headers
# B: request body
# h: response headers
# b: response body
--pretty=none # all | colors | format
Authentication:
--session NAME
-a, --auth USER:PASS
--auth-type basic
--auth-type digest
Downloading:
--download
--continue
-o, --output FILE
Others:
--follow # follow redirects
--timeout SECONDS
--verify no # skip SSL verification
--proxy http:http://foo.bar:3128