Last active
July 8, 2023 00:34
-
-
Save forksofpower/45c600ec8ee063e811c2b00174d79ebf to your computer and use it in GitHub Desktop.
Sample `.http` File for microservice development
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@baseUrl = http://localhost | |
@postsApi = {{baseUrl}}:4000 | |
@commentsApi = {{baseUrl}}:4001 | |
@queryApi = {{baseUrl}}:4002 | |
### | |
# 1. create a new post | |
# @name post | |
POST {{postsApi}}/posts HTTP/1.1 | |
Content-Type: application/json | |
{ | |
"title": "Test Post {{$guid}}" | |
} | |
### | |
# 2. Add a comment to the post | |
@postId = {{post.response.body.id}} | |
# @prompt message | |
POST {{commentsApi}}/posts/{{postId}}/comments HTTP/1.1 | |
Content-Type: application/json | |
{ | |
"content": "{{message}}" | |
} | |
### | |
# 3. List all Posts and comments | |
GET {{queryApi}}/posts HTTP/1.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment