728x90
putmapping
-
Spring Boot - PUT APIFramework & Library/Spring Boot 2022. 2. 1. 18:22
PUT API @PutMapping @PutMapping(value = "/default") public String putMethod() { return "Hello World"; } - PUT API를 제작하기 위해 사용되는 애너테이션이다. - PUT API는 리소스의 업데이트를 위해 사용되는 API이며, 해당 리소스가 존재하면 갱신하고, 리소스가 없을 경우 생성해주는 API이다. - 기본 적인 동작 방식은 POST API와 동일하다. - 컨트롤러와 매핑된 URL로 PUT 요청을 하면, "Hello World"가 응답되는 것을 확인할 수 있다. @RequestBody @PutMapping(value = "/member") public String putMember(@RequestBody Map put..