The Wayback Machine - https://web.archive.org/web/20200613151135/https://github.com/Kong/insomnia/issues/2012
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Improvement] Plugin API to send new request in response hook #2012

Open
4n70w4 opened this issue Mar 29, 2020 · 1 comment
Open

[Improvement] Plugin API to send new request in response hook #2012

4n70w4 opened this issue Mar 29, 2020 · 1 comment

Comments

@4n70w4
Copy link

@4n70w4 4n70w4 commented Mar 29, 2020

Is your feature request related to a problem? Please describe.
An external API does not always respond successfully. Server errors for example 50x or 429 Too Many Requests may occur. Manually pressing the send button while waiting for a successful response can be tedious.

Describe the solution you'd like
Be able to set the number of retries and the expected/unexpected status codes of the response. As well as the interval between requests.

@gschier
Copy link
Contributor

@gschier gschier commented Mar 30, 2020

That's an interesting request! I'm not sure it makes sense to add such a specific feature directly to Insomnia, but it would be nice if the plugin API supported creation of such plugins.

Currently, there is a "response hook" plugin API for intercepting responses but there is no exposed way to send a new request from there. If there was, a plugin could be written to intercept all responses, check status code, and resend if necessary.

Note, this may be as simple as exposing the network context to the responseHook scope https://support.insomnia.rest/article/26-plugins#context.network

@gschier gschier changed the title [Feature Request] Auto retry send request if status code not equals 200 [Improvement] Plugin API to send new request in response hook Mar 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.