post-request script #6242
-
It would be great if Insomnia supported such thing. It is available in Postman (tab Tests) and allows for example setting environment variable from response. Insomnia support single environment variable from single requests, but sometimes it is required to set same environment variable from multiple requests (i.e. multiple variations of login requests that could set access token to environment variable, so it could be used by other requests). There is also issue requesting such/similar feature (#1968). It is also similar to discussed pre-request scripts in #3806. There are probably many ways how to implement this, but personaly I find scripts to be most transparent, because all settings are within request configuration and are transfered upon reqest duplication and so on. Are there any plans for such feature? You can find my attempt on post request script at https://github.com/petoc/insomnia/tree/feature-script . |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments 19 replies
-
Hello @subnetmarco, are there any plans to include this post-request script feature in the upcoming releases? |
Beta Was this translation helpful? Give feedback.
-
To recap in the main thread, this capability will ship in a minor 9.1 immediately after 9.0 (when we ship pre-request scripting). |
Beta Was this translation helpful? Give feedback.
-
This issue has been fixed in 9.1 |
Beta Was this translation helpful? Give feedback.
-
@subnetmarco @ihexxa Will it be possible to manipulate the response (body/header)? Currently this is not possible current feature branches. Would be interesting, for example, if you want to chain requests to fetch auth tokens where you have to transform the responses |
Beta Was this translation helpful? Give feedback.
-
The latest 9.3.0 beta includes this capability, please try it out and let us know your feedback! |
Beta Was this translation helpful? Give feedback.
-
This is useless since setting environment variables does not work via the CLI :( |
Beta Was this translation helpful? Give feedback.
-
After response scripting has been released today in Insomnia 9.3 GA. |
Beta Was this translation helpful? Give feedback.
-
var data = insomnia.response.json(); |
Beta Was this translation helpful? Give feedback.
The latest 9.3.0 beta includes this capability, please try it out and let us know your feedback!