Skip to content

Request and Response in Kurtosis #684

Answered by mieubrisse
shreyasbhat0 asked this question in Q&A
Discussion options

You must be logged in to vote

This can be done via the extract field that's available on GetHttpRequestRecipe, PostHttpRequestRecipe, and ExecRecipe in combination with plan.wait.

The way extract works is that, when the Recipe is run (via plan.request for Get/PostHttpRecipe and plan.exec for ExecRecipe), the result object will be a dictionary containing future references to the extracted values.

E.g. if you define a recipe with an extract of valueOfMyKey, response["extract.valueOfMyKey"] will be a future to that value at execution time:

recipe = GetHttpRequestRecipe(
    port_id = "my_port",
    endpoint = "/some-endpoint",
    extract = {
        # Uses jq to extract the value of the key
        "valueOfMyKey" : ".my…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mieubrisse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants