Difference between revisions of "HTTPie"

From RHS Wiki
Jump to navigation Jump to search
Line 5: Line 5:
 
== 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 ==
 
== 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

Revision as of 10:11, 14 February 2019

HTTPie

Alternative to curl

Install

sudo apt install httpie

GET

http 127.0.0.1:8000
http --follow GET 127.0.0.1:8000/ 'Authorization: Bearer ey**...**Sg'

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/ username=rafa password=1234qwer