【发布时间】:2019-11-18 23:12:07
【问题描述】:
简单的 POST 方法在 Karate API 中不起作用,在 POSTMAN 中可以正常工作, 出现如下错误
错误 com.intuit.karate - java.net.ConnectException:连接被拒绝:连接,http 调用在 1101 毫秒后失败,网址为:https://api.stripe.com/v1/customers
在 POSTMAN 和浏览器中运行良好 网址:https://api.stripe.com/v1/customers
I tried with karate-apache / karate-jersey
Feature: Pharmacies Get Default City Code
Background:
* url pharmaciesUrl
@GetPharmaciesByDefaultCity
Scenario: Create New Customers
Given url pharmaciesUrl
And header Content-Type = 'application/x-www-form-urlencoded'
And header Authorization = 'Bearer sk_test_Y566a568oL0lbYwRurOvJ4g6'
Then request {"email": "test1@test.com", "name": "vivek", "description": "Test"}
When method POST
Then status 200
And match response == {id: '#notnull', name: 'vivek'}
Expected: It should create customer with post request which I am passing with status code 200
Actual: Getting below error
09:25:07.278 [main] ERROR com.intuit.karate - java.net.ConnectException: Connection refused: connect, http call failed after 1101 milliseconds for URL: https://api.stripe.com/v1/customers
09:25:07.279 [main] ERROR com.intuit.karate - http request failed:
java.net.ConnectException: Connection refused: connect
pharmacies.feature:12 -`enter code here`
java.net.ConnectException: Connection refused: connect
【问题讨论】:
标签: karate