WayneSan / insomnia-plugin-stringreplace

Replace a string by a pattern or Regular Expression inside the Insomnia REST client.

Home Page:https://npmjs.com/insomnia-plugin-stringreplace

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use Response Body as "Source String"

vermgit opened this issue · comments

I don't know what the intended use-case is, but what's definitely missing is the opportunity to refer to something else in Insomnia, e.g. a Response Body.

Example: I execute a request that returns a JSON with a part of a URL A. Now I want to build a new request that uses A, but needs to replace parts of it:

Request #1: GET http://server/path/to/something
Response:
{
  "data": {
    "refUrl": "/otherPath/pointing/somewhere/useful"
  }
}

Request #2: GET http://server{<reference to refUrl>.replace("useful", "awesome")}

In the current state of the plugin I can only replace "useful" with "awesome" on a fixed string.