VS Code Rest Client : get array response element at specific index

33 Views Asked by At

Using VSCode Rest Client, I would like to have an item of the response to a specific index in order to be able to use it automatically in another query.

For exemple I have an enpoint in an api that return a list of an object

public class WeekSummaryDto
{
    public int WeekId { get; set; }
    public string Country{ get; set; }
    public double BenefitPotential { get; set; }
    public double Benefit{ get; set; }
    public int Week { get; set; }
    public int Year { get; set; }
    public bool? IsSuccess { get; set; }
}
[HttpGet("GetWeeksSummary")]
public IEnumerable<WeekSummaryDto> GetWeeksSummary()
...

And I have this first request

###

# get all weeks summary
# @name GetWeeksSummary
GET {{baseUrl}}/GetWeeksSummary HTTP/1.1

###

How to get the Benefit of the first item of the response array and use it in another request ?

0

There are 0 best solutions below