我有这个测试 Postman 流。“发送请求”块调用 Postman echo API。
下面是我在postman echo API上使用的查询。
作为一个测试,我想从第一个“发送请求”块的响应中获取ParamKey1的值,并将其设置为第二个“发送请求”块的ParamKey2的值。因此,终端应该输出如下所示的内容:
--- [11:10:62]
data:
status: '200'
body:
args:
ParamKey1: ParamValue1
ParamKey2: ParamValue1
headers:
x-forwarded-proto: https
x-forwarded-port: '443'
host: www.postman-echo.com
x-amzn-trace-id: Root=1-635c1747-3f6540ef480363162df797d5
headerkey1: HeaderValue1
accept: application/json
content-type: application/json
user-agent: PostmanRuntime/7.29.2
cache-control: no-cache
postman-token: 65e322d6-0902-409e-aa33-06708fd968d7
accept-encoding: 'gzip, deflate, br'
cookie: >-
sails.sid=s%3A9xptL5itn2oEwj4NxkYfXoSsDgS13YWi.iaAtzHY1w0Eruqz%2FE%2FqNvWXBCveZAxR%2BTexowwOnjF0
url: 'https://www.postman-echo.com/get?ParamKey1=ParamValue1&ParamKey2=OK'
headers:
Date: 'Fri, 28 Oct 2022 17:54:15 GMT'
Content-Type: application/json; charset=utf-8
Content-Length: '640'
Connection: keep-alive
ETag: W/"280-JzDhIiJr9HLb7DpmhfeDR5s/2T8"
Vary: Accept-Encoding
set-cookie: >-
sails.sid=s%3AmRRu0ezsQK6_4JXiBy0AwjwJdt9sep8j.fe%2F%2Blx4Fx6wtY5MFUpSkdJQ3JqJFoUFM9MaohQeuLkc;
Path=/; HttpOnly
http:
statusCode: 200
statusMessage: OK
responseTime: 253
'@durable': {}
现在它只给予我一个选项来获取作为字符串的主体,如下所示:
我怎样才能让我上面描述的工作呢?
1条答案
按热度按时间bnl4lu3b1#
解决方案1:
在请求2中,您可以直接将路径输入
Current Value
,选择类型ref
并忽略警告。解决方案2: