mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
[GH-ISSUE #5410] [bug]: WHY PRE-REQUEST SCRIPT CAN NOT USE "fetch"????? #2075
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#2075
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @xzajyjs on GitHub (Sep 27, 2025).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/5410
Is there an existing issue for this?
Platform
Desktop App
Browser
Chrome
Operating System
macOS
Bug Description
Title suggestion:
Pre-request script: no support for fetch or custom HTTP requests?
Body:
I ran into a major limitation when using pre-request scripts in Hoppscotch.
No matter what JavaScript code I write in the pre-request script, as soon as I try to use fetch—one of the most fundamental and widely used HTTP request functions in JavaScript—it fails. Even something as simple as a plain GET request with no params or body will throw an error. To make things worse, the error messages are not informative at all, so debugging is nearly impossible.
This limitation makes me seriously frustrated, especially since one of the most common real-world scenarios is chaining requests across multiple APIs: passing secrets, keys, or tokens step by step to reach a secure endpoint. Without the ability to make a request (or at least reuse responses from another request in a collection), pre-request scripts lose much of their usefulness.
I spent a lot of time digging through the documentation (72 hours straight, literally line by line), but I found no mention of this. Other tools (e.g. Postman, Insomnia) highlight this feature as essential, and some even provide automatic conversion for Postman pre-request scripts. For a project with 70k+ stars, it’s surprising that such a basic capability seems to be missing.
Questions:
This is a critical feature for many API testing workflows. If it’s not supported, could it be considered for the roadmap?
Deployment Type
Self-hosted (on-prem deployment)
Version
No response
@sagar290 commented on GitHub (Oct 3, 2025):
/assign
@RoooyHe commented on GitHub (Oct 10, 2025):
I can't find any way to send HTTP from pre-request when fetch can't be used
@jamesgeorge007 commented on GitHub (Nov 19, 2025):
Hi #5596 is now up, implementing
fetch(),hopp.fetch(), andpm.sendRequest()in the experimental scripting sandbox as part of the ongoing scripting improvements (https://github.com/hoppscotch/hoppscotch/discussions/5221). This enables making HTTP requests from the scripting context with interceptor integration.On another note, you can use
fetch()in the scripting context with limited capabilities by opting out of theExperimental scripting sandboxvia settings.Please track the further progress in #3305.
@jamesgeorge007 commented on GitHub (Nov 27, 2025):
The above scripting enhancements are now live with the v2025.11.0 release.