session_id, POST forwarding and custom_headers.
Uses: Fetch with session_id, POST and PUT requests and custom_headers
Ask your AI agent
With the Zenrows MCP server connected to Claude, Cursor or any MCP client, paste this prompt. Your agent picks the right Zenrows tools and settings on its own.Keep the same IP across requests
Add the samesession_id (a number from 1 to 99999) to every request that must share an IP. Zenrows keeps that IP for 10 minutes. This example calls https://httpbin.io/ip, which echoes the caller’s IP.
Example output
session_id returns the same IP. A new value starts a new session with a new IP.
Submit a login form with POST
Send a POST to the Fetch endpoint and Zenrows forwards the body to the target. Here the body is the login form of a demo site, and the response is the page the site redirects to after login.Python (Requests)
Zr- prefix. Zr-Cookies holds the cookies the site set, ready to send back on the next request.
Send form and JSON bodies
Fetch forwards the body and itsContent-Type as you send them. https://httpbin.io/anything echoes what it receives, so you can see both shapes arrive.
Send your own cookies and headers
Setcustom_headers=true and Zenrows forwards the headers you add to the request, such as Cookie, Referer or an authorization header. It keeps managing the browser fingerprint headers for you.
Zr-Cookies, then send those cookies with custom_headers=true and the same session_id on every following request.
Customize it
Troubleshooting
- The IP changes between requests with the same
session_id: the requests ran on different configurations. Send the same parameters on each one, such aspremium_proxy=true, with the samesession_id. - Every request on a session comes back blocked: that IP is flagged by the site. Switch to a new
session_idvalue. - The site does not see your header: add
custom_headers=trueto the request. Browser fingerprint headers such asUser-AgentandAccept-Languagestay managed by Zenrows. - The POST returns the login page again: the form needs a token from the page, such as a CSRF field. Use Log in and reuse sessions to run the flow in a real browser.
Related recipes
Log in once and reuse the session
Run full login flows in a real browser and keep the cookies.
Click, fill, and scroll before you scrape
Fill a field and click a button inside a Fetch request.
Get content as seen from any country
Pick the country your session comes from.
Fill and submit multi-step forms
Drive complex forms step by step in the browser.