Skip to content
Ameen Abozaid
Planned lessonJNR-018-L03

Choosing status codes

  • Lesson 3 of 6
  • Junior
On This Lesson 4 topics

This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.

In this lesson

pick the status code that tells the client exactly what happened.

Planned topics

  • 2xx success: 200 OK, 201 Created, 204 No Content.
  • 4xx client mistake: 400 bad input, 401 not authenticated, 403 not allowed, 404 not found, 409 conflict, 422 valid shape but invalid meaning.
  • 5xx server fault: 500, 503.
  • Creation returns 201, not 200. A successful delete with no body returns 204.
  • The status code is part of the contract; clients branch on it.
Draft outline details

Demonstration

SituationCode
Product created201
Product not found404
Duplicate SKU409
Missing required field400

Check your understanding

Which code for "you are logged in but may not do this"?

Show answer

403.

Practice

Apply this lesson with the module's lab, exercises and quiz.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Continue to next lesson

Type to search levels, phases, modules and lessons.