Changes

Jump to navigation Jump to search
137 bytes added ,  09:43, 15 April 2019
m
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'
 
  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

Navigation menu