简体   繁体   English

如何在 Visual Studio Code REST 客户端请求中多次提交相同的 GUID

[英]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?当我需要在多个实例中使用相同的 GUID(例如 HTTP 标头和正文)时,我该如何实现呢?

Doing it like this generates multiple GUIDs:这样做会生成多个 GUID:

...
###
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": [
...

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从 Visual Studio 中的 Swagger 文件更新 REST API 客户端 - How to update REST API Client from a Swagger file in Visual Studio 如何防止同时执行REST API的多次执行? - How Can I Prevent Multiple Execution of REST API in same time? 缺少 Visual Studio“REST Api 客户端” - Visual Studio "REST Api Client" missing 如何使用REST API更新Visual Studio Team Services构建定义? - How can I update a Visual Studio Team Services build definition using the REST api? 如何创建可以在邮递员请求中多次使用的生成器函数? - How do I create generator function that can be used multiple times in a postman request? 自动 Rest API 客户端 Visual Studio 不重试失败 - Auto Rest API Client Visual Studio no retry on failure 在 Visual Studio 默认选项中添加 REST API 客户端 - Add REST API Client in Visual Studio Default Option 当端口不面向公众时,如何为客户端应用程序(端口443)提供使用同一服务器上的REST API(端口9000)的功能? - How can I provide a client application (port 443) the ability to consume a REST API (port 9000) on the same server when the port is not public facing? 如何使用 RestTemplate,json 使用 java 在同一时间多次发送相同的请求 - How to send the same request multiple times in the same time with java using RestTemplate,json 如何在 React 中通过 post 请求提交输入值? - How can I submit an input value with a post request in React?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM