Spring/이론

delete방식-- 삭제할 때 사용//talend Api//

SEOKIHOUSE 2023. 7. 31. 16:48
  • DELETE API - 웹 애플리케이션 서버를 거쳐 데이터베이스 등의 저장소에 리소스를 삭제할 때 사용



practice0731_ApiTest.zip
0.09MB

package com.study.springboot;

import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/delete-api")
public class DeleteController {
	
	@DeleteMapping(value="/{variable}")
	public String deleteVariable(@PathVariable String variable) {
		return variable;
	}
	
	@DeleteMapping(value="/request1")
	public String getRequestParam1(@RequestParam String email) {
		return "email: " + email;
	}
}