Skip to content

Instantly share code, notes, and snippets.

@brunokrebs
Created February 6, 2018 22:01
Show Gist options
  • Save brunokrebs/6aa582dc85b789cf2ab402f6507bfc07 to your computer and use it in GitHub Desktop.
Save brunokrebs/6aa582dc85b789cf2ab402f6507bfc07 to your computer and use it in GitHub Desktop.
# issue a POST request to get a token
curl -X POST -H 'Content-Type: application/json' -d '{
username: "mario",
password: "secret"
}' http://localhost:63939/api/token
# replace xxx.yyy.zzz with the token retrieved in the previous command
JWT="xxx.yyy.zzz"
# use the token to retrieve books
curl -H 'Authorization: Bearer '$JWT http://localhost:63939/api/books
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment