Kong / Kong/insomnia

[Feature Request] Making 'raw' requests inside request hooks

Open
#1,939 2 comments 0 reactions 0 assignees View on GitHub
Feature Request needs-triage
Dominant language
TypeScript
Stars
40k
Forks
2.4k
Avg merge
2d 13h
Merged PRs (30d)
61

Description

**What is your question?**
I wrote a little plug-in that adds a header to all my requests. The header value comes from another request that I have to make from the plug-in. So far I used a request library to do so, but I saw [in the docs](https://support.insomnia.rest/article/26-plugins#context.network) that there should be a network object in the context object and I would like to use it. But my context object has only app, data, request and store. This is basically what I would like to do:

```javascript
module.exports.requestHooks = [
async ctx => {
await ctx.network.sendRequest(...).then(...)
}
]
```

I couldn't find anything about the removal of this API in the changelog. Am I doing something wrong?

Contributor guide

Open the contributing guide

Research direction

Start with the plugin documentation linked in the issue, especially the context.network section, then inspect how request hooks receive their context. Determine whether raw requests can be exposed through that context; done means the requested hook usage is supported or the limitation and intended alternative are clearly documented, with appropriate coverage identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.