상세 컨텐츠

본문 제목

DELETE API

Back-end/JavaSpringBoot

by 본투비곰손 2022. 8. 17. 23:28

본문

728x90

리소스의 삭제 (멱등성, 안정성 없음)

 

get와 동일 하다고 생각하면되고 항상 200 OK를 리턴 값이 있던지 없던지 삭제하고 반환

 

package com.example.deleteapi.controller;

import org.springframework.web.bind.annotation.*;

@RequestMapping("/api")
@RestController
public class DeleteController {

    @DeleteMapping("/delete/{userId}")
    public void delete(@PathVariable String userId, @RequestParam String account){

        System.out.println(userId);
        System.out.println(account);

    }

}
728x90

'Back-end > JavaSpringBoot' 카테고리의 다른 글

PUT API  (0) 2022.08.17
POST API  (0) 2022.08.16
Get API  (0) 2022.08.16
SpringBoot를 사용하여 "hello spring boot" 출력하기  (0) 2022.08.16
스프링 부트 란?  (0) 2022.08.04

관련글 더보기