mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[GH-ISSUE #5776] [question]: pm.sendRequest usage on pre-request script #2259
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#2259
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 @Leon-Luu on GitHub (Jan 16, 2026).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/5776
Is there an existing issue for this?
Platform
Web App
Browser
Chrome
Operating System
Windows
Bug Description
When executing the pm.sendRequest from the Pre-request Script it will resulting as TypeError as failure.
If the code is executed in Post-request script it is working fine.
I beleive that pm.sendRequest should be supported for "Pre-request Script" as well, if not I am requesting this :)
Deployment Type
Hoppscotch Cloud
Version
v2025.12.1
@jamesgeorge007 commented on GitHub (Jan 16, 2026):
Hi, the ability to send requests from the scripting context is supported in both pre-request and post-request scripts. However, the sample snippet encountered issues because the
pm.expect()function is not recognised in pre-request scripts. Ideally, this would be flagged via IntelliSense.We are aware of cases where type definitions can overlap between scripting editors, causing certain functions to appear valid when they are not. This is being tracked separately and would cease to exist once the unified scripting experience is in place.