Request Node
Last updated
Last updated
You can use a request node to execute a GET, POST, PUT and DELETE request with proper request body and parameters.
Anything within double curly braces {{ }}
is treated as a variable. Each request node takes two types of variables -
These are the set of variables LOCAL to an API request and can be used by the API request before it fires. For Instance, you can define your url as https://petstore3.swagger.io/api/v3/pet/{{petId}}
and then define a pre-request variable as shown below.
A variable can of the following type -
Select - Selects a part of the output from the previous node. For instance previous node is request node that outputs { "id": 10, "category" : [ {"id" : 10, "status" : "available"} ], .....}
, then you can use petId = id
or petId = category.0.id
The actual values will be calculated on the fly when the graph is run.
String - Assigns a value of type string to the variable. petId = "10"
Number - Assigns a value of type number to the variable. petId = 10
Boolean - Assigns a value of type boolean to the variable. petId = false
Now - Assigns a value of type now() epoch timestamp to the variable. The value of now() is calculated on the fly during graph run. petId = Date.now()
Post response variables are GLOBAL and can be referenced by other downstream nodes. These are variables that are created after an API request has fired. One of the big advantages of these types of variable is that you can create a variable and assign it a value extracted from the response of an API request. For instance if the one node fired an API request, you can create a variable, assign it a value selected from it's response and use that in next node.
If a node has a pre-request variable defined of the same name as post response variable of a previous node, it will take more precedence.