API Fundamentals
/Intermediate
3xx Redirection Codes
Definition
HTTP status codes ranging from 300-399. They indicate that further action needs to be taken by the user agent (browser) in order to fulfill the request, usually by navigating to a different URL.
Explain Like I'm New
The server saying: 'The thing you are looking for isn't here anymore, but I know where it is. Go look over there instead.'
Real World Example
You try to visit `http://google.com`. The server returns a `301` redirecting you to `https://google.com` (forcing encryption). You try to access a private dashboard without logging in. The server returns a `302` redirecting you to the `/login` page.
Common Use Cases
- •SEO preservation
- •Authentication routing
- •Domain migrations
Interactive Example
Loading...
Console output will appear here...
Interview Questions
basic
- What is the difference between a `301` and a `302` redirect?
intermediate
- What is a `304 Not Modified` code, and how does it save massive amounts of bandwidth?