ResponseApiController data class UserRequest( var name: String? = null, var age: Int? = null, var email: String? = null, var address: String? = null, var phoneNumber: String? = null ) @RestController @RequestMapping("/api/response") class ResponseApiController { // 1. get 4XX -> Error // GET http://localhost:8080/api/response?age=10 @GetMapping("") fun getMapping(@RequestParam age: Int?): Respon..
PutApiController @RestController @RequestMapping("/api") class PutApiController { @PutMapping("/put-mapping") fun putMapping(): String { return "put-mapping" } @RequestMapping(method = [RequestMethod.PUT], path = ["/request-mapping"]) fun requestMapping(): String { return "request-mapping - put method" } //Post와 동일, Put -> 내용없으면 생성, 있으면 수정 @PutMapping(path = ["/put-mapping/object"]) fun putMappi..
package com.example.mvc.controller.get import com.example.mvc.model.http.UserRequest import org.springframework.web.bind.annotation.* @RestController //REST API @RequestMapping("/api") //localhost:8080/api class GetApiController { //Get 주소를 노출할때 사용 하는 방법 : 최근 //@GetMapping("/hello") : http://localhost:8080/api/hello @GetMapping(path = ["/hello", "/abcd"]) //Get http://localhost:8080/api/hello, G..