Skip to content

Instantly share code, notes, and snippets.

@danielplawgo
Created April 2, 2021 04:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielplawgo/bf6d7aa07bafddaba282e4e5024b8169 to your computer and use it in GitHub Desktop.
Save danielplawgo/bf6d7aa07bafddaba282e4e5024b8169 to your computer and use it in GitHub Desktop.
Visual Studio Code REST Client

@baseUrl = http://localhost:5000

# @name createProductRequest POST {{baseUrl}}/api/Products HTTP/1.1 Content-Type: application/json

{

"name": "Nazwa produktu", "description": "Opis"

}

###

@productId = {{createProductRequest.response.body.id}}

GET http://localhost:5000/api/Products HTTP/1.1

###

@baseUrl = http://localhost:5000

###

GET {{baseUrl}}/api/Products HTTP/1.1

###

# @name createProductRequest POST {{baseUrl}}/api/Products HTTP/1.1 Content-Type: application/json

{

"name": "Nazwa produktu", "description": "Opis"

}

###

@productId = {{createProductRequest.response.body.id}}

###

GET {{baseUrl}}/api/Products/{{productId}} HTTP/1.1

###

PUT {{baseUrl}}/api/Products/{{productId}} HTTP/1.1 Content-Type: application/json

{

"id": "{{productId}}", "name": "nowa nazwa", "description": "Opis"

}

###

DELETE {{baseUrl}}/api/Products/{{productId}} HTTP/1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment