question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide a variable to access the request information

See original GitHub issue

Provide a variable, similar to response, which can make it easier to access the information about the request sent by Karate. The rationale is to make the request and response available to external Java classes accessed through Java Interop.

More details available on the StackOverflow question, https://stackoverflow.com/questions/46846367/accessing-the-built-request-details-in-karate/

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
createamcommented, Nov 24, 2017

@ptrthomas Makes sense. Saw that you have already changed the name. Thanks for making this update.

0reactions
ptrthomascommented, Nov 23, 2017

@createam great. actually I thought hard about it. each built-in variable adds bloat to the context, which becomes painful especially when doing a call to other features - since the return value is an aggregate of all variables. so considering that this is a 0.01 % use case (you are the first to request this) I felt this is better. plus it would be for those who are writing frameworks on top of karate like you are, and know what you are doing. the other consideration is it gets low-level, for e.g. the request body is held as a byte-array, which you need to deal with.

I’m thinking that karate.prevRequest might be a slightly better name, what do you think ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Provide a variable to access the request information · Issue #226
Provide a variable, similar to response, which can make it easier to access the information about the request sent by Karate.
Read more >
Use parameters to ask for input when running a query
To make a query in Access desktop databases ask for criteria when you run it, create a parameter query. This allows you to...
Read more >
How do I access the request object or any other variable in a ...
The answer by Ber - storing it in threadlocals - is a very bad idea. There's absolutely no reason to do it this...
Read more >
Passing variables between pages using URL GET or POST ...
There are different ways by which values of variables can be passed between pages. One of the ways is to use the URL...
Read more >
can we access variables which are available in request ...
I am trying to use variables which are available for the requested item if yes which method I need to use to access...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found