Karate: Allow non-JSON body using karate.request

Created on 27 Feb 2017  路  3Comments  路  Source: intuit/karate

Writing reusable functions it would be nice not to be limited to using JSON here.
The documentation states that

TODO: right now only JSON HTTP calls are supported by karate.request(req)

Maybe I could have a look at this .. I guess a good starting point is ScriptContext/ScriptBridge

wontfix

Most helpful comment

@hascode I think you will like the new change where you can re-use entire *.feature files.

Here is the documentation (in the develop / 0.2.4-SNAPSHOT) branch: link

With this implemented, there is no need for having to make HTTP calls from JS anymore. Which I think is a huge deal :)

All 3 comments

Yes @hascode ScriptBridge is the place, I think with the addition of a "headers" object that allows one to set the content-type and accept headers, most use-cases would be covered.

@hascode I think you will like the new change where you can re-use entire *.feature files.

Here is the documentation (in the develop / 0.2.4-SNAPSHOT) branch: link

With this implemented, there is no need for having to make HTTP calls from JS anymore. Which I think is a huge deal :)

@ptrthomas Excellent! I'm preparing a blog article about this framework based on my experiments here: https://bitbucket.org/hascode/karate-bdd-testing and I'm going to update my re-usable JS-login-function to use the new feature of calling separate features from a file instead (and the latest version of karate of course).

Was this page helpful?
0 / 5 - 0 ratings