HTTP Method 4가지→
package com.example.blog1.test;
import org.springframework.web.bind.annotation.*;
//사용자가 요청 -> 응답(HTML 파일)
//@Controller
//사용자가 요청 -> 응답(Data)
@RestController
public class HttpControllerTest {
//http://localhost:8080/http/get
@GetMapping("/http/get")
public String getTest(){
return "get 요청";
}
//http://localhost:8080/http/post
@PostMapping("/http/post")
public String postTest(){
return "post 요청";
}
//http://localhost:8080/http/put
@PutMapping("/http/put")
public String putTest(){
return "put 요청";
}
//http://localhost:8080/http/delete
@DeleteMapping("/http/delete")
public String deleteTest(){
return "delete 요청";
}
}
GET요청→


Post→ 인터넷 브라우저 요청은 무조건 get 요청밖에 할수없다.



나머지 메서드들은 Postman을 통해서 확인할수 있다.

Put 요청→

Delete 요청→

GET 요청방식