How to fix "ERROR com.intuit.karate - http request failed: null" while trying to make post call in KARATE DSL?

Viewed 1356

Below is my feature file content. While executing the runner class for this feature file I am facing this error "16:09:06.508 [main] ERROR com.intuit.karate - http request failed: null".

Feature: To test POST leads API

Scenario: Test with valid flow
Given url leads
And request { "lastName": "Anderson", "email": "sam.anderson@matrix.com",    "phoneNumber": 39123345,    "privacyVersion": "1.1",    "marketing": true }
When method post
Then status 200
And match response == {"referenceId": '#notnull'}
And match response == {"referenceId": '#string'}

Get request is working fine.

1 Answers

Most likely the url is mal-formed and does not start with http.

Note that the un-helpful error message will be fixed in the next version (0.9.4)

Related