请注意,我正在尝试发送以下请求并使用 url 验证 POST 方法的响应
http://uat-ws.*.uk.***.ws/index.php/*/****/validatevoucher
如下所示:我在这里使用空手道框架来自动化 REST API
Scenario: validate voucher
Given url 'http://-..uk../v3//******'
And header Content-Type = 'application/json'
And request {json request here}
When method post
Then status 200
12:17:30.510 [main] DEBUG com.intuit.karate.StepDefs - response time in milliseconds: 579 12:17:30.528 [main] ERROR com.intuit.karate.StepDefs - FAILED, status code was 400, expected 200
[31mFailed scenarios:[0m [31mexamples/users/WSS.feature:3 [0m# Scenario: validate voucher
1 Scenarios ([31m1 failed[0m) 5 Steps ([31m1 failed[0m, [32m4 passed[0m) 0m3.516s
com.intuit.karate.KarateException: status code was 400, expected 200 at com.intuit.karate.StepDefs.handleFailure(StepDefs.java:516) at com.intuit.karate.StepDefs.status(StepDefs.java:447) at ✽.Then status 200(examples/users/WSS.feature:9)