Varun Patil
Varun Patil

Reputation: 165

Karate - Variable to access request just like response

Is there a variable like response for request in karate. I tried to look at the github issues and found the below example, but this does not seem to work for me.

* def temp = (karate.lastRequest)
* print '==============>' +(temp.body)

Upvotes: 2

Views: 769

Answers (1)

Babu Sekaran
Babu Sekaran

Reputation: 4239

Its karate.prevRequest

    * def temp = karate.prevRequest
    * def requestMethod = temp.method
    * def requestBody = temp.body

please find more example here

Upvotes: 1

Related Questions