vscode-restclient
vscode-restclient copied to clipboard
How to run several requests in a kind of loop statement
I have the requirement to send nearly the same POST request to a backend system several times. The only difference is a varialble that I have set. @group_number = 0051 Within the payload of my request I would have something like "group_number" : "{{group_number}}" Currently I am editing the value and send the request manually. Is there a way to do this in a programmatic way? Sending N http requests thereby changing a variable so that the payload changes? Kind regards, Andre
It would be nice if the API looks like this to keep my tool compatible with rest-client
for ... of ...
Variable $index
and Variable Name is injected in Variables for every iteration
{{
exports.data = [1, 2, 3];
}}
###
# @loop for item of data
GET https://httpbin.org/anything?item={{item}} HTTP/1.1
for ...
Variable $index
is injected in Variables for every iteration
# @loop for 4
GET https://httpbin.org/anything?item={{$index}} HTTP/1.1
while ...
Variable $index
is injected in Variables for every iteration
{{
exports.expression = {
index: 0,
};
}}
###
# @loop while expression.index < 3
GET /anything?item={{expression.index++}} HTTP/1.1
how can it use in POST body ??
Can this be configured to make the requests asynchronously so that httpyac doesn't wait for the responses?
Any updates on this?