Bird
0
0

What is the main difference between a 301 and a 302 redirect in REST APIs?

easy📝 Conceptual Q1 of 15
Rest API - HTTP Status Codes
What is the main difference between a 301 and a 302 redirect in REST APIs?
A301 is temporary, 302 is permanent
B301 is permanent, 302 is temporary
CBoth are permanent redirects
DBoth are temporary redirects
Step-by-Step Solution
Solution:
  1. Step 1: Understand HTTP redirect status codes

    301 means the resource has moved permanently, while 302 means it has moved temporarily.
  2. Step 2: Compare the permanence of redirects

    Clients and search engines treat 301 as permanent and update links, while 302 does not.
  3. Final Answer:

    301 is permanent, 302 is temporary -> Option B
  4. Quick Check:

    Redirect type = Permanent (301) or Temporary (302) [OK]
Quick Trick: 301 = permanent redirect, 302 = temporary redirect [OK]
Common Mistakes:
  • Confusing which redirect is permanent
  • Assuming both redirects behave the same
  • Thinking 302 updates bookmarks permanently

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes