Skip to content

Instantly share code, notes, and snippets.

@d11z
Created December 2, 2018 00:25
Show Gist options
  • Save d11z/ec4e66ea6138bc13f6c83b189b3ab51a to your computer and use it in GitHub Desktop.
Save d11z/ec4e66ea6138bc13f6c83b189b3ab51a to your computer and use it in GitHub Desktop.
@host = http://localhost:8080/api
###
# @name register
POST {{host}}/login
Content-Type: application/json
{
"username": "tester",
"password": "password"
}
###
# @name login
POST {{host}}/login
Content-Type: application/json
{
"username": "tester",
"password": "password"
}
###
# @name newPost
@token = {{login.response.body.token}}
POST {{host}}/posts
Authorization: Bearer {{token}}
Content-Type: application/json
{
"title": "example post",
"url": "http://google.com",
"category": "test"
}
###
# @name getPosts
GET {{host}}/posts
###
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment