What it means
The method-preserving 301. This is what an HTTP-to-HTTPS or trailing-slash redirect should use for an API, so a POST is not silently downgraded to a GET.
- Class
- 3xx Redirection
- Defined in
- RFC 7538
- Cached by default
- Yes, without explicit headers
When you receive a 308
- Resend the same request, method and body unchanged, to the
LocationURL - and use that URL from now on. - Every current browser and mainstream HTTP library follows a 308 the same way.
When you send a 308
- Use it for permanent moves on anything that receives
POST,PUTorPATCH: HTTP to HTTPS, a trailing-slash rule, a renamed path. - Search engines treat it like
301and move the ranking to the new URL. - It is cached like a 301, so be sure before you ship it.
On the wire
HTTP/1.1 308 Permanent Redirect Location: https://api.example.com/v2/orders