🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: REST APIs: all 10 questions

Quiz: REST APIs · Question 10 of 10

What does ResponseEntity.created(uri).body(course) send?

What does ResponseEntity.created(uri).body(course) send?

  1. A.200 OK and the course
  2. B.204 No Content
  3. C.302 redirect to the URI
  4. D.201 Created with a Location header pointing to the new course, plus the body
Answer & explanation

Correct answer: 201 Created with a Location header pointing to the new course, plus the body

Clients learn where the new resource lives from the Location header.

Can you get the rest right without peeking?

Take the timed Quiz: REST APIs quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →