Skip to content

insomnia.sendRequest is causing the after response script execution forever. #8897

Description

@Sravanchitiprolu

Expected Behavior

while calling the insomnia.sendRequest, expect to call the API with the details passed and retrun response in the after response script.

Actual Behavior

It is making the after script execute forever with out and end.

Reproduction Steps

  1. Open the API request
  2. Go to script tab
  3. Click on after response tab
  4. Script below is failing and making the after response script to execute for ever.
    Example 1:
    const resp = await
    insomnia.sendRequest(
    {
    url: '',
    method: 'POST',
    headers: [
    { name: 'Content-Type', value: 'application/json' },
    { name: 'Authorization', value: authToken }
    ],
    body: {
    mimeType: 'application/json',
    text: JSON.stringify(postData)
    }
    }
    );
    console.log('Pricing API response:', resp.statusCode, resp.body);

Example 2:
const resp = await new Promise((resolve, reject) => {
insomnia.sendRequest(
{
url: '',
method: 'POST',
headers: [
{ name: 'Content-Type', value: 'application/json' },
{ name: 'Authorization', value: authToken }
],
body: {
mimeType: 'application/json',
text: JSON.stringify(postData)
}
}, (err, resp) => {
if (err != null) {
reject(err);
} else {
resolve(resp);
}
}
)
});
Both of this didn't work.

Is there an existing issue for this?

Which sync method do you use?

  • Git sync.
  • Insomnia Cloud sync.
  • Local only

Additional Information

No response

Insomnia Version

11.3.0

What operating system are you using?

macOS

Operating System Version

15.5

Installation method

downloaded dmg from insomnia site

Last Known Working Insomnia version

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

B-bugBug: general classificationS-unverifiedStatus: Unverified by maintainer

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions