ExamGecko
Question list
Search
Search

Question 45 - 2V0-72.22 discussion

Report
Export

Refer to the exhibit.

How can a response status code be set for No Content (204)? (Choose the best answer.)

A.
Annotate the update() handler method with @PutMapping(“/store/orders/{id”}”,HttpStatus.NO_CONTENT).
Answers
A.
Annotate the update() handler method with @PutMapping(“/store/orders/{id”}”,HttpStatus.NO_CONTENT).
B.
Annotate the update() handler method with @ResponseStatus(HttpStatus.NO_CONTENT).
Answers
B.
Annotate the update() handler method with @ResponseStatus(HttpStatus.NO_CONTENT).
C.
Annotate the update() handler method with @ResponseEntity(204).
Answers
C.
Annotate the update() handler method with @ResponseEntity(204).
D.
The update() handler method cannot return a void type, it must return a ResponseEntity type.
Answers
D.
The update() handler method cannot return a void type, it must return a ResponseEntity type.
Suggested answer: C

Explanation:

Reference: https://stackoverflow.com/questions/55691288/is-this-the-correct-way-to-return-204-nocontent-using-spring

asked 16/09/2024
Osman Rana
36 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first