Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 100124

Variable use in POST request with REST Client for Visual Studio Code

$
0
0

I am using REST client with VSC for testing. I have a question about the use of variables in POST request.

I have added an item in one request. I can get the id from the response. Then I want to use the id in a different POST request. It doesn't seem to work:-(

### GET /categories/:id
@minivanId = {{createMinivan.response.body.$._id}}
GET {{baseUrl}}/categories/{{minivanId}} <=== this works

### POST /categories/update
@sedanId = {{createSedan.response.body.$._id}}
POST {{baseUrl}}/categories/update
Content-Type: {{contentType}}

{"id": {{sedanId}}, "name":"New Sedan"} <== this doesn't work


Viewing all articles
Browse latest Browse all 100124

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>