我正在尝试在获得 API 响应的地方发布 API 请求
"d": { "__metadata": { "uri": "http://ev-qa02.zs.local/IncentiveManager/0002i1/wcf/v5.svc/InDataRequestCreators('9f31c6da-ec56-4360-8589-d21b6320f99b' )”,“类型”:“ZSAssociates.Javelin.ETL.Rest.v5.InDataRequestCreator”},“ScenarioId”:“9f31c6da-ec56-4360-8589-d21b6320f99b”,“CallbackUrl”:“”,“DataExpiresOnUtc”:“ /日期(4103913600000)/”,“CreateScenarioIfMissing”:假,“AdapterId”:“0fcbd8d2-f5cb-4e2a-bda8-bb37037b022d”,“InDataRequestIdOut”:“eb36f8a9-5b7d-4835-88f6-4af67830c1e9”,“InDataRequestId:” "/InDataRequests('eb36f8a9-5b7d-4835-88f6-4af67830c1e9')" } }
现在我正在尝试发送另一个 API 请求,其中我的 URL 是 http://ev-qa02.zs.local/IncentiveManager/0002i1/WCF/V5.svc/InDataRequests ('eb36f8a9-5b7d-4835-88f6-4af67830c1e9 ')/文件创建者
*InDataRequests('eb36f8a9-5b7d-4835-88f6-4af67830c1e9') 这个随机数是从上面的响应值“InDataRequestIdOut”生成的
如何附加 URL 以获取先前的 API 响应并添加到我的第二个 POST 请求中。我无法捕获我的响应并在其他 API POST 请求中使用它?如果您能在这里帮助我,我将不胜感激,因为几天以来一直被困在这个问题上,我也浏览了文档和示例,但无法解决这个问题。我也附上了截图。PostUrlFailureScreenshot 我的主要问题是来自 ecipe screenshot 的第 26 和 27 行
Scenario: Verify that JIM Idr request ofr Post
Given header Content-Type = 'Application/JSON'
And header Accept = 'Application/JSON'
And header Authorization = 'Basic
UUEwMl9JbmNlbnRpdmVNYW5hZ2VyXzAwMDJpMTpZWkxaRjlGclR1eWhlcVNJbXlkTlBR'
Given path 'InDataRequestCreators'
* def user =
"""
{
"ScenarioId":"9f31c6da-ec56-4360-8589-d21b6320f99b",
"AdapterId":"0fcbd8d2-f5cb-4e2a-bda8-bb37037b022d",
"DataExpiresOnUtc":"2100-01-18T00:00:00",
"CreateScenarioIfMissing":"false"
}
"""
And request user
When method post
Then status 201
* print 'the value of response is:', response
And def app = response
And path 'app.InDataRequestIdOut' + '/FileCreators'
* def body =
"""
{
"InDataRequestId": "1d6326a2-d25f-41d2-9303-8a6e6101efcc",
"ProcedureName": "",
"SourceWorkspacePath": ""
}
"""
And request body
When method post
Then status 201