Follow the gudang’s moving notices hop by hop: what is left of a POST through a 302 or a 307, where a token goes when the host changes, and how many times…
Redirects are everywhere: HTTP to HTTPS, www to bare domain, login walls, old URLs that moved, the Post/Redirect/Get pattern, download links to a CDN. Pick the wrong code and a payment POST arrives as an empty GET; rules that throw at each other make a TypeError after 20 hops; and redirect: 'manual' gives you no Location at all.
Each 3xx code has its own rule for the method and the body
POST with 301/302, then finding its body gone Browsers turn a POST into a body-less GET on 301 and 302. If the method and body must stay, use 307 (temporary) or 308 (permanent).302 and 307 are the same since both are temporary Both are temporary, but only 307 promises the method will not change. The difference shows on a POST: 302 makes it a GET, while PUT and DELETE stay as they were.fetch fails with a TypeError (in the address bar: ERR_TOO_MANY_REDIRECTS). It often happens when HTTPS and trailing-slash rules throw at each other. Check the Location at every hop.redirect: 'manual' to read Location In a browser, manual gives an opaqueredirect response: status 0, no headers. To learn the last address, leave it on follow and read res.url and res.redirected.POST with a 302 It arrives as a GET, its basket left at the gudang.307 or 308 for a POST The POST and its body reach the new address whole.redirect: 'manual' The code gets a sealed response: status 0, no Location.