# Returning ResponseEntity&lt;T>

Return a ResponseEntity from a controller method to choose the status code, for example 404 when a category isn't found and 500 when something fails.

![Cheat sheet: Returning ResponseEntity&lt;T>](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/a3ae979e383942b9805402383b6c97b1.webp)

- Category: Spring Boot
- Level: Journeyman
- Tags: rest-api, Spring Boot
- Updated: November 3, 2026

Source: https://www.ask-codey.com/cheat-sheets/returning-http-status-codes-returning-responseentity-t-cheat-sheet
