Following redirects
Choose whether Relay follows redirects, how many, and what it sends to the next location.
Overview
When a server answers with a redirect, such as 301 Moved Permanently or 302 Found, Relay follows it to the URL in the Location header and shows you the final response. You can turn this off to see the redirect itself, limit how many redirects Relay follows, and decide what the next request carries.
Redirect settings have defaults in Relay > Settings > Network. A workspace, collection, folder or request can override any of them in its Settings tab, and the most specific level that sets a value wins. WebSocket requests don't follow redirects, so their Settings tab doesn't show these options.
Set the defaults
Choose Relay > Settings, click Network, then use the Redirects section:
| Setting | Default | What it does |
|---|---|---|
| Follow Redirects | On | Follow redirects to their location. When it's off, the response inspector shows the redirect response itself. |
| Maximum Redirects | 10 | The most redirects Relay follows for one request, from 1 to 50. |
| Follow Original Method | Off | After a 301 or 302, repeat the original method and body instead of switching to GET. |
| Keep Authorization Across Origins | Off | Send the Authorization header when a redirect leads to another host, scheme or port. |
You can change the same defaults in the Workspaces window: select Globals, then click Settings (the gear button).
Override the settings for a group of requests or one request
- Open the level's settings:
- For a request, click Settings (the gear button) in the request editor, or press Command-7.
- For a collection or folder, Control-click it in the sidebar, choose Edit Variables…, then click Settings (the gear button) in the Collection Settings window.
- For a workspace, click the workspace menu, choose Edit Workspaces…, select the workspace and click Settings (the gear button).
- In the Redirects card, choose a value for each setting you want to change.
Each setting's menu shows what it inherits and where from, such as Default (On) or Inherit (On, from Collection “Payments API”). Choose On or Off, or for Maximum Redirects choose Custom and enter a number. To go back to the inherited value, choose its Default or Inherit item.
For more about how levels combine, see Configuring request settings.
Understand what's sent to the next location
Each redirect status changes the next request in its own way:
- 301 and 302: Relay resends a POST to the new location as a GET without a body, as browsers do. Turn on Follow Original Method to repeat the original method and body instead.
- 303: Relay always switches to GET.
- 307 and 308: Relay always repeats the original method and body.
When a redirect leads to another origin, meaning a different scheme, host or port, Relay drops the Authorization header so your credentials don't reach a server you didn't send them to. Turn on Keep Authorization Across Origins when you trust the other server, such as an API that redirects from api.example.com to files.example.com.
If a request reaches the maximum number of redirects and the server redirects again, the send fails with a message such as "Stopped after 10 redirects, the limit set for this request."
See the redirects a request followed
When a response came through redirects, the response inspector shows how many beside the status badge, such as 2 Redirects. Hold the pointer over it to see the chain of statuses, such as 301 → 302 → 200, and click it to open the Headers tab.
- Headers: Between the request and response headers, a card for each redirect shows its status, the request it answered and its headers. The cards start collapsed; click one to expand it.
- Timeline: The Redirect Chain shows how long each request in the chain took.
See Also
- Configuring request settings: Set the timeout, redirect behavior, proxy and certificate checks for a request or a group of requests.
- Measuring request timing: See where a request spent its time, from DNS lookup to the last byte, including each redirect.
- Inspecting responses: Read a response's status, body and headers, and copy or save what you need.
- Configuring Relay settings: Change Relay's defaults for requests, networking, history, code export and the MCP server.