繁体   English   中英

How to use one REST API RESPONSE property, and use it in another REST API header property

[英]How to use one REST API RESPONSE property, and use it in another REST API header property

我想知道如何将财产从一个 REST API 转移到另一个 REST ZDB974238714CA8DE634A7ACE

I worked on the property transfer with the JSON format, but I need to know how to transfer the one REST API response property and use it in the header?

让我用下面的场景解释一下:

  1. 管理员通过 API 获取用户 object
  2. 保存用户 object 的 apiKey
  3. 代表用户调用操作(通过使用用户 apiKey 将Authorization Header设置为Basic

要在soapUI 中完成这些步骤,您必须:

  1. TestCaseCustom Properties中定义apiKey
  2. 调用返回用户 object 的资源
  3. 通过属性转移或Groovy步骤将apiKey属性保存到TestCase.apiKey
  4. 通过Basic ${=(testCase.getPropertyValue("apiKey")+":").bytes.encodeBase64()}在您的巢REST Request步骤中重用TestCase.apiKey

在此处输入图像描述

希望有帮助

暂无
暂无

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

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