Praveen Kumar
Praveen Kumar

Reputation: 123

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

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": "[email protected]",    "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.

Upvotes: 2

Views: 2494

Answers (2)

Shlomi Cohen
Shlomi Cohen

Reputation: 213

For us the problem was apache httpclient 4.5.13 , turns out that karate 0.9.2 didn't work well with it

taking a lower version 4.5.5 for example - solved the problem until we will upgrade.

Upvotes: 0

Peter Thomas
Peter Thomas

Reputation: 58058

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)

Upvotes: 2

Related Questions