스프링 PathVariable 어노테이션

@PathVariable 이란? REST API에서 URI에 사용되는 변수이다. 예를 들면, 아래 URI에서 밑줄 친 부분이 @PathVariable로 처리해줄 수 있는 부분이다. localhost:8080/api/user/1234 music.bugs.co.kr/album/4062464 2개가 필요할 경우 따로 따로 선언 해주면 된다. @PutMapping("/posts/{postId}/comments/{commentId}") public void editComment(@PathVariable Long postId,@PathVariable Long commentId, @RequestBody CommentRequestDto commentrequestDto) { commentService.editCommen..
imSoo
'스프링 PathVariable 어노테이션' 태그의 글 목록