VSCode REST Client Extension - Increment Variable Value

14 Views Asked by At

In a REST Client script for VsCode, is there a way to increment a variable?

###
# @name Init
GET http://some/restapi/v1/example

@PageNumber = {{Init.response.body.PageNumber}}  // 27 for this example
@PageNumberPlusOne = {{PageNumber}} + 1          // aka 28

###
# @name apiPageNumberPlusOne 
GET http://some/restapi/v1/example&page={{PageNumberPlusOne}}
// http://some/restapi/v1/example&page=27+1      // desired value is 28
0

There are 0 best solutions below