简体   繁体   中英

How can I submit the same GUID multiple times in a Visual Studio Code REST Client request

When I need to use the same GUID in several instances - eg HTTP Header and Body - how can I achieve this?

Doing it like this generates multiple GUIDs:

...
###
POST https://host.acme.com/someapi
Content-Type: application/json; charset=UTF-8
Correlation-Id: {{$guid}}

{
  "CorrelationId": "{{$guid}}",
  "Record": [
...

This can be achieved by defining and using a variable

...
###
@corrid = {{$guid}}
POST https://host.acme.com/someapi
Content-Type: application/json; charset=UTF-8
Correlation-Id: {{corrid}}

{
  "CorrelationId": "{{corrid}}",
  "Record": [
...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM