bruno icon indicating copy to clipboard operation
bruno copied to clipboard

Access to interpolated values for scripting purposes

Open elazzabi opened this issue 7 months ago • 3 comments

I have checked the following:

  • [X] I've searched existing issues and found nothing related to my issue.

Describe the feature you want to add

Currently, during the scripting phase, it is not possible to get interpolated values.

For example: req.getUrl() will return {{baseURL}}/users/{{userId}} instead of localhost:3000/users/123.

I believe it's better to have these values interpolated by default. Or at least provide both options.

This https://github.com/usebruno/bruno/discussions/1469 is related

Mockups or Images of the feature

For two options:

  getUrl() {
    return this.req.url;
  }

  getInterpolatedUrl() {
    return interpolateString(this.req.url);
  }

Or by default:

  getUrl() {
    return interpolateString(this.req.url);
  }

elazzabi avatar Jul 05 '24 11:07 elazzabi