
경로가 동일하더라도 호출하는 method가 GET, POST, PUT, PATCH, DELETE 인가에 따라서 다른 결과 값이 반환
@GetMapping()@GetMapping("/")
public String getMethod(){
return "GET Method";
}
@PostMapping()@PostMapping("")
public String postMethod(){
return "Post Method";
}
@PutMapping()@PutMapping("")
public String putMethod(){
return "put Method";
}
@PatchMapping()@PatchMapping("")
public String patchMethod(){
return "patch Method";
}
@DeleteMapping()@DeleteMapping("")
public String deleteMethod(){
return "Delete Method";
}
⚠️주의
@GetMapping("/first")
public String getFirst(){
return "get First";
}