Difference between revisions of "HTTPie"
Jump to navigation
Jump to search
Rafahsolis (talk | contribs) |
Rafahsolis (talk | contribs) m (→GET) Tag: visualeditor |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
| − | = [https://httpie.org/doc HTTPie] = | + | =[https://httpie.org/doc HTTPie]= |
Alternative to curl | Alternative to curl | ||
| − | == Install == | + | ==Install== |
sudo apt install httpie | sudo apt install httpie | ||
| − | == GET == | + | ==GET== |
http 127.0.0.1:8000 | http 127.0.0.1:8000 | ||
| + | http --follow GET 127.0.0.1:8000/ 'Authorization: Bearer ey**...**Sg' | ||
| − | == POST == | + | === get with parameters === |
| + | <syntaxhighlight lang="bash"> | ||
| + | echo '{"query": {"match_all": {}}}' | http GET :9200/_count?pretty | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | ==POST== | ||
http --follow POST 127.0.0.1:8000/auth/api-token-auth/ | http --follow POST 127.0.0.1:8000/auth/api-token-auth/ | ||
http --follow POST 127.0.0.1:8000/auth/api-token-auth/ username=rafa password=1234qwer | http --follow POST 127.0.0.1:8000/auth/api-token-auth/ username=rafa password=1234qwer | ||
Latest revision as of 09:43, 15 April 2019
HTTPie[edit]
Alternative to curl
Install[edit]
sudo apt install httpie
GET[edit]
http 127.0.0.1:8000 http --follow GET 127.0.0.1:8000/ 'Authorization: Bearer ey**...**Sg'
get with parameters[edit]
echo '{"query": {"match_all": {}}}' | http GET :9200/_count?pretty
POST[edit]
http --follow POST 127.0.0.1:8000/auth/api-token-auth/ http --follow POST 127.0.0.1:8000/auth/api-token-auth/ username=rafa password=1234qwer