When to use a ResponseEntity in Spring Boot #shorts

preview_player
Показать описание
I often see Spring Developers returning a ResponseEntiy and not manipulating the response. If all you're doing is returning a body just use the type as the return type. If you need to add headers or change status codes you can use ResponseEntity as the return type 🤷‍♂️

🔗Resources & Links mentioned in this video:

👋🏻Connect with me:

Рекомендации по теме
Комментарии
Автор

Straight to the point as always. Thanks!

SouhaibD
Автор

On point! See these examples a lot, seems like an anti-pattern that got quite common lately.

vuk
Автор

Silently changing some methods... Bye! 🤯

ferlezcano