![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbMgzgu%2FbtsvMWUAUDq%2FHoLjZfMF0cG08YjoNieNc0%2Fimg.png)
@PathVariable
·
Framework/SPRING BOOT
http://localhost:8090/app/swagger-ui.html SOAP과 다르게 REST 방식에서는 요청 URL에 어떤 작업할지 내포가 안되기 때문에 method를 통해서 무슨 작업인지를 알려주게 된다. 예> http://localhost:8090/app/name/hong/age/20 값을 얻기 위해서 사용하는게 @PathVariable 어노테이션이고 위 URI에서 20 부분이 @PathVariable로 처리해줄 수 있는 부분이다. 사용법 @GetMapping(" /{변수명}")에 => 꼭 Get이 아니어도 된다. 상관없음. 위에 쓴 변수명을 그대로 @PathVariable("변수명") GET POST & 여러개인 경우 PUT DELETE