[GH-ISSUE #4558] [feature]: Interceptor integration with request sending abilities in the scripting context #1676

Closed
opened 2026-03-16 21:21:30 +03:00 by kerem · 4 comments
Owner

Originally created by @norcino on GitHub (Nov 25, 2024).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4558

Originally assigned to: @jamesgeorge007 on GitHub.

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

When I try to send an HTTP request from within the Pre-request Script, there requests don't go through the configured Interceptor, I tried with the agent and the browser extension.
the same request work fine if sent from a standard Request tab.

If I try to use mode no-cors I don't get error but I cannot access the response from the call.
Affects both web and local.

Steps to reproduce

const basicAuthHeaderValue = btoa(pw.env.get("username") + ':' + pw.env.get("password"));
const url = MY-URL;
fetch(url, {
method: 'GET',
// mode: 'no-cors',
header: {
'Authorization': Basic ${basicAuthHeaderValue},
'Content-Type': 'application/json; charset=utf-8'
}
}).then(res => {
return res.text();
}).then(bearerToken => {
[...]
}).catch(err => console.error("Ups..", err));
}

Environment

Production

Version

Local

Originally created by @norcino on GitHub (Nov 25, 2024). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4558 Originally assigned to: @jamesgeorge007 on GitHub. ### Is there an existing issue for this? - [X] I have searched the existing issues ### Current behavior When I try to send an HTTP request from within the **Pre-request Script**, there requests don't go through the configured **Interceptor**, I tried with the agent and the browser extension. the same request work fine if sent from a standard **Request** tab. If I try to use mode no-cors I don't get error but I cannot access the response from the call. Affects both web and local. ### Steps to reproduce const basicAuthHeaderValue = btoa(pw.env.get("username") + ':' + pw.env.get("password")); const url = `MY-URL`; fetch(url, { method: 'GET', // mode: 'no-cors', header: { 'Authorization': `Basic ${basicAuthHeaderValue}`, 'Content-Type': 'application/json; charset=utf-8' } }).then(res => { return res.text(); }).then(bearerToken => { [...] }).catch(err => console.error("Ups..", err)); } ### Environment Production ### Version Local
kerem 2026-03-16 21:21:30 +03:00
  • closed this issue
  • added the
    feature
    label
Author
Owner

@filipjnc commented on GitHub (Apr 16, 2025):

I have the same, rendering pre-request scripts useless. Any suggestions?

<!-- gh-comment-id:2810021567 --> @filipjnc commented on GitHub (Apr 16, 2025): I have the same, rendering pre-request scripts useless. Any suggestions?
Author
Owner

@romil4 commented on GitHub (May 8, 2025):

Same here. Kindly advise.

<!-- gh-comment-id:2864675151 --> @romil4 commented on GitHub (May 8, 2025): Same here. Kindly advise.
Author
Owner

@jamesgeorge007 commented on GitHub (Nov 19, 2025):

#5596 is now up, implementing fetch(), hopp.fetch(), and pm.sendRequest() in the experimental scripting sandbox as part of the ongoing scripting improvements (#5221). This enables making HTTP requests from the scripting context with interceptor integration.

<!-- gh-comment-id:3554213160 --> @jamesgeorge007 commented on GitHub (Nov 19, 2025): #5596 is now up, implementing `fetch()`, `hopp.fetch()`, and `pm.sendRequest()` in the experimental scripting sandbox as part of the ongoing scripting improvements (#5221). This enables making HTTP requests from the scripting context with [interceptor](https://docs.hoppscotch.io/documentation/features/interceptor) integration.
Author
Owner

@jamesgeorge007 commented on GitHub (Nov 27, 2025):

Closing since the respective scripting enhancements are now live with the v2025.11.0 release.

<!-- gh-comment-id:3585216275 --> @jamesgeorge007 commented on GitHub (Nov 27, 2025): Closing since the respective scripting enhancements are now live with the [v2025.11.0 release](https://github.com/hoppscotch/hoppscotch/releases/tag/2025.11.0).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#1676
No description provided.