Capture HTTP Request from Server Side on NextJS
1. Problems
When calling an HTTP/HTTPS Request from the server-side NextJS by using fetch(), it's really difficult to debug the network. The workaround is using the console.log() to print out the Request/Response on the Terminal app.
Therefore, it's a nightmare when debugging a large codebase with hundreds of requests.
This blog will cover the following:
- How to capture HTTP/HTTPS Request from Server Side on NextJS 15 with Proxyman
2. Solution
Proxyman introduces the Automatic Setup that opens the pre-configured Terminal app. By starting your NextJS Server on this Terminal, Proxyman automatically captures all HTTP/HTTPS from your NextJS Project.
Benefits:
- No need to config the proxy
- No need to trust the Proxyman Certificate
- Work out of the box
- Easier to set up than using the Reverse Proxy Tool
Here is the walkthrough:
- Tell
fetch()not to reuse a stored result by usingcache: 'no-store'when you need every request to reach the server.
export default async function MyPage() {
const res = await fetch('https://httpbin.org/anything', { cache: 'no-store' })
return <div>My Page{res.text()}</div>
}=> Cache behavior depends on the Next.js version and whether the route is built ahead of time or rendered for each request. Development hot reload can also reuse a Server Component fetch result.
=> { cache: 'no-store' } makes Next.js fetch from the remote server for each request, which is useful while you verify the call in Proxyman.
- Open Proxyman -> Setup -> Automatic Setup -> Open new Terminal

- From this Terminal -> Start your NextJS here with
npm run dev

- Done, all HTTP/HTTPS from
fetch()are captured and intercepted by Proxyman.

3. What's next
- If you prefer using your own Terminal app, you can use the Manual Setup. Let's follow these Documents to know how to set up: https://docs.proxyman.com/automatic-setup/manual-setup
- Automatic/Manual Setup Tool works with NodeJS, Python, and Ruby.
Run the Next.js command in the terminal opened by Proxyman; the setup belongs to that terminal session. If a call still does not appear, use a full page navigation rather than hot reload and confirm the code path runs on the server. Browser-side fetch calls follow the browser setup instead.
