Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJoel Meador
300 PointsIs 202 appropriate for the error code on this video? 201 seems more correct for a normal web app.
201 Created 202 Accepted
My understanding is 202 is generally for event stream processors and other types of systems that have some input lag between data receipt and data persistance/system effect.
2 Answers
Mohsen Qaddoura
22,237 PointsFirst, let's clarify that the 200-299 are not 'error' codes, they are server response status codes expressing the success of receiving and understanding the requester request and a server action has been taken. Then they must provide some feedback information of the server action about the client specific request.
But still you have got a point here, as per the video, the 202 means the resource has been created as per the request, which it is not, that would be confirmed by the code 201. 202 is more like the server responding to the client with : noted but I will process your request later, you do not need to maintain/persist the connection. And it must also clarify how it will notify the requester with the final status of the request to create the resource. For more specific standards on all codes including more detailed quoting of the standards on these two codes you can check the official w3 protocols here :
https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
And for information about the W3 itself, the community setting the standards for the web, including the standards mentioned above, and is led by the inventor of the web himself, Tim Berners-Lee check :
Kenneth Love
Treehouse Guest TeacherYeah, so, that's all me. I'm gonna see about getting a fix.
Joel Meador
300 PointsJoel Meador
300 PointsYeah, "error code" was a typo. "status code"