Fieldmark Documentation
Technical notes / Open reference
Contents ▾
GUIDE / HTTP REFERENCE

Following redirects without losing the method.

Redirect responses tell a client where to continue, but the status code changes how it should continue.

Editorial team ·

Know which redirects preserve the method

A 307 Temporary Redirect and a 308 Permanent Redirect preserve the original method and request body. A 303 See Other generally directs the client to retrieve the new location using GET, or HEAD when applicable. Historical browser behaviour around 301 and 302 can also turn a POST into GET. That may be acceptable for a page navigation but dangerous if an API client is expected to repeat a write operation.

Inspect Location at every hop

The Location field identifies the next target, which may be an absolute or relative reference. Resolve relative locations according to the response URL, not the page you originally opened. Record each status and target when diagnosing a loop or a surprising destination. A client following redirects automatically can hide intermediate errors. An apparently successful final page does not prove that the chain was intentional or that the original method survived.

Consider caching and scope

Permanent redirects can be cached, so changing a rule may not immediately affect every visitor. Avoid broad redirection of unknown paths to the homepage; it makes missing resources harder to detect and can mislead clients expecting a 404. Validate destinations constructed from request headers, particularly behind proxies. Redirecting a sensitive request to another origin may disclose information even if the response eventually appears normal.

Test the same client behaviour

Use a command that displays status, Location and method at each step. Compare a GET navigation with a POST request when the route accepts writes, and inspect whether the client forwards headers across origins. A safe static documentation site generally uses direct local links instead of a large redirect web. The examples section shows ordinary response shapes; use them alongside this guide rather than assuming all user agents follow every redirect identically.

Keep reading

Continue with the start here index, or explore the overview for the wider context. To explore the behaviour, send a request to a controlled test server and record both its conditions and the response. Compare the result with the rule described above. An illustrative HTTP exchange should never be presented as a measurement of a remote service.