230805_Sat

KH·2023년 8월 4일
0

TIL

목록 보기
46/58

Problems

멘토링 준비
ResponseEntity

Attempts

멘토링

ResponseEntity 쓰는 이유
https://stackoverflow.com/questions/26549379/when-use-responseentityt-and-restcontroller-for-spring-restful-applications

(284vote 답변)

ResponseEntity는 전체 HTTP 응답을 나타내도록 설계됨.
상태 코드, 헤더 및 본문(body)에 들어가는 모든 것을 제어 가능함.

@ResponseBody는 HTTP body
@ResponseStatus는 HTTP status

@ResponseStatus는 유연하지 않음.
헤더를 설정할 수 없어서 추가로 HttpServletResponse가 필요함.

기본적으로 ResponseEntity가 이것저것 조절할 수 있음.

메세지 앱 데이터베이스 참고
https://vertabelo.com/blog/database-model-for-a-messaging-system/

Results

Insights

profile
What, How, Why

0개의 댓글