DEV Community

Cover image for 💡 𝗛𝗮𝘃𝗲 𝗬𝗼𝘂 𝗘𝘃𝗲𝗿 𝗘𝗻𝗰𝗼𝘂𝗻𝘁𝗲𝗿𝗲𝗱 𝗛𝗧𝗧𝗣 𝗦𝘁𝗮𝘁𝘂𝘀 𝗖𝗼𝗱𝗲𝘀 𝗧𝗵𝗮𝘁 𝗛𝗲𝗹𝗽𝗲𝗱 𝗬𝗼𝘂 𝗦𝗼𝗹𝘃𝗲 𝗖𝗼𝗺𝗽𝗹𝗲𝘅 𝗜𝘀𝘀𝘂𝗲𝘀? 𝗛𝗲𝗿𝗲’𝘀 𝗛𝗼𝘄 𝗧𝗵𝗲𝘆 𝗪𝗼𝗿𝗸 𝗮𝗻𝗱 𝗪𝗵𝘆 𝗧𝗵𝗲𝘆 𝗠𝗮𝘁𝘁𝗲𝗿!
Apurv Upadhyay
Apurv Upadhyay

Posted on

💡 𝗛𝗮𝘃𝗲 𝗬𝗼𝘂 𝗘𝘃𝗲𝗿 𝗘𝗻𝗰𝗼𝘂𝗻𝘁𝗲𝗿𝗲𝗱 𝗛𝗧𝗧𝗣 𝗦𝘁𝗮𝘁𝘂𝘀 𝗖𝗼𝗱𝗲𝘀 𝗧𝗵𝗮𝘁 𝗛𝗲𝗹𝗽𝗲𝗱 𝗬𝗼𝘂 𝗦𝗼𝗹𝘃𝗲 𝗖𝗼𝗺𝗽𝗹𝗲𝘅 𝗜𝘀𝘀𝘂𝗲𝘀? 𝗛𝗲𝗿𝗲’𝘀 𝗛𝗼𝘄 𝗧𝗵𝗲𝘆 𝗪𝗼𝗿𝗸 𝗮𝗻𝗱 𝗪𝗵𝘆 𝗧𝗵𝗲𝘆 𝗠𝗮𝘁𝘁𝗲𝗿!

Image description
When your browser interacts with a server, it returns a 𝟯-𝗱𝗶𝗴𝗶𝘁 𝗛𝗧𝗧𝗣 𝘀𝘁𝗮𝘁𝘂𝘀 𝗰𝗼𝗱𝗲 that indicates how the request was processed. These codes provide essential information about whether the request succeeded, if further action is needed, or if an error occurred.

𝗞𝗲𝘆 𝗖𝗮𝘁𝗲𝗴𝗼𝗿𝗶𝗲𝘀:

🟣 𝟭𝘅𝘅 (𝗜𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻𝗮𝗹): The request was received, and the process is ongoing.
🟢 𝟮𝘅𝘅 (𝗦𝘂𝗰𝗰𝗲𝘀𝘀): The request was successfully received and processed.
🔵 𝟯𝘅𝘅 (𝗥𝗲𝗱𝗶𝗿𝗲𝗰𝘁𝗶𝗼𝗻): Further action is required to complete the request.
🟠 𝟰𝘅𝘅 (𝗖𝗹𝗶𝗲𝗻𝘁 𝗘𝗿𝗿𝗼𝗿): There is an error in the request (e.g., bad syntax or unauthorized).
🔴 𝟱𝘅𝘅 (𝗦𝗲𝗿𝘃𝗲𝗿 𝗘𝗿𝗿𝗼𝗿): The server failed to fulfill a valid request.

𝗪𝗵𝘆 𝗛𝗧𝗧𝗣 𝗦𝘁𝗮𝘁𝘂𝘀 𝗖𝗼𝗱𝗲𝘀 𝗠𝗮𝘁𝘁𝗲𝗿:

• 𝗖𝗼𝗺𝗺𝘂𝗻𝗶𝗰𝗮𝘁𝗶𝗼𝗻: Simplifies communication between client and server.
• 𝗘𝗿𝗿𝗼𝗿 𝗛𝗮𝗻𝗱𝗹𝗶𝗻𝗴: Helps identify and troubleshoot issues.
• 𝗔𝘂𝘁𝗼𝗺𝗮𝘁𝗶𝗼𝗻: Assists in automating tasks like load balancing and scaling.

𝗕𝗲𝘀𝘁 𝗣𝗿𝗮𝗰𝘁𝗶𝗰𝗲𝘀:

🔹 𝗨𝘀𝗲 𝗦𝗽𝗲𝗰𝗶𝗳𝗶𝗰 𝗖𝗼𝗱𝗲𝘀: Always use the most relevant code to describe the outcome.
🔹 𝗕𝗲 𝗖𝗼𝗻𝘀𝗶𝘀𝘁𝗲𝗻𝘁: Apply status codes uniformly across your application.
🔹 𝗟𝗼𝗴 𝗮𝗻𝗱 𝗠𝗼𝗻𝗶𝘁𝗼𝗿: Logging status codes is crucial for performance tuning and debugging.

I’ve written a detailed post on Medium, providing step-by-step explanations and examples. Feel free to check it out! 🗞️📜 https://apurvupadhyay.medium.com/-3868fac50db9

Please repost this 🔁 if you find it useful. 🔔 Follow Apurv Upadhyay ☁️ for more content like this#𝗛𝗧𝗧𝗣 #𝗪𝗲𝗯𝗗𝗲𝘃𝗲𝗹𝗼𝗽𝗺𝗲𝗻𝘁 #𝗦𝘁𝗮𝘁𝘂𝘀𝗖𝗼𝗱𝗲𝘀 #𝗦𝗲𝗿𝘃𝗲𝗿𝗖𝗼𝗺𝗺𝘂𝗻𝗶𝗰𝗮𝘁𝗶𝗼𝗻#𝗗𝗲𝘃𝗲𝗹𝗼𝗽𝗲𝗿𝗧𝗶𝗽𝘀

Top comments (0)