Simple POST request is not working in Karate API, same will work fine in POSTMAN, please suggest anything wrong in 'request'

后端 未结 1 516
醉梦人生
醉梦人生 2021-01-27 02:52

Simple POST method is not working in Karate API, which works fine in POSTMAN, getting error as below

ERROR com.intuit.karate - java.net.ConnectException: Connection ref

相关标签:
1条回答
  • 2021-01-27 03:13

    You haven't read the documentation and you did not realize this is an HTML form submit. The Content-Type should have given you a hint. Here is your solution:

    Given url 'https://api.stripe.com/v1/customers'
    And header Authorization = 'Bearer sk_test_Y566a568oL0lbYwRurOvJ4g6'
    And form field email = 'test1@test.com'
    And form field name = 'vivek'
    And form field description = 'Test'
    When method post
    Then status 200
    
    0 讨论(0)
提交回复
热议问题