Skip to content

Latest commit

 

History

History
67 lines (46 loc) · 1.49 KB

File metadata and controls

67 lines (46 loc) · 1.49 KB

Sample HTTPIE requests

  1. Walk through the in README first
  2. Start your server
npm start / npm run dev
  1. Open another terminal
  2. Try out the requests below

GET /

http GET :4000

POST /echo

http POST :4000/echo hello="world" number:=0 cheesesArray:='["cheddar", "rochefort", "stilton"]'

POST /signup

http POST :4000/signup email="[email protected]" password="test1234" name="John Doe"

POST /login

http POST :4000/login email="[email protected]" password="test1234"

GET /me

Get a token first:

http POST :4000/login email="[email protected]" password="test1234"
http GET :4000/me Authorization:"Bearer <PASTE_YOUR_TOKEN_HERE>"
http GET :4000/me Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEsImlhdCI6MTU4NDYwNzIyMSwiZXhwIjoxNTg0NjE0NDIxfQ.PcK4zqUIuA347cW7jdLFSH-86RckZtPw4RFeChwqh2o"

POST /authorized_post_request

Get a token first:

http POST :4000/login email="[email protected]" password="test1234"
http POST :4000/authorized_post_request Authorization:"Bearer <PASTE_YOUR_TOKEN_HERE>" hello="world" number:=0 cheesesArray:='["cheddar", "rochefort", "stilton"]'
http POST :4000/authorized_post_request Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjIxLCJpYXQiOjE1ODQ2MTQxMjYsImV4cCI6MTU4NDYyMTMyNn0.3WKeq1MmGQaq5iMSds3ff8JNBJa5D2k3DDW645OFrAY" hello="world" number:=0 cheesesArray:='["cheddar", "rochefort", "stilton"]'