Delete: 리소스삭제,DROP, 멱등성, PathVariable, Queryparameter
삭제를 위한것이기 때문에 많은 값을 받지 않음(DB Index number, account)
package com.example.delete.Controller;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/api")
public class DeleteApiController {
@DeleteMapping("/delete/{userid}")
public void delete(@PathVariable String userid, @RequestParam String account){
System.out.println(userid);
System.out.println(account);
}
}
delete는 해당 리소스가 있던 없던 삭제연산이기 때문에 데이터만 정확하게 넣어준다면
200(oK)가 된다.