투케이2K

116. (spring/스프링) [PUT] PutMapping 사용해 http put 요청 api 생성 실시 본문

Spring

116. (spring/스프링) [PUT] PutMapping 사용해 http put 요청 api 생성 실시

투케이2K 2023. 1. 15. 15:56
반응형

[개발 환경 설정]

개발 툴 : inteli j

개발 언어 : spring

 

[소스 코드]

    // -----------------------------------------------------------------------------------------
    // TODO [SEARCH FAST] : [PUT] : http 요청 수행 실시
    // -----------------------------------------------------------------------------------------
    @PutMapping("/put_request_test")
    public String put_request_test(@RequestHeader Map<String, Object> requestHeader, @RequestBody Map<String, Object> body){
        S_Log.d("\n");
        S_Log.d("================================================");
        S_Log.d("[CLASS] : "+String.valueOf(CLASS_NAME));
        S_Log.d("-----------------------------------------");
        S_Log.d("[METHOD] : "+String.valueOf("put_request_test"));
        S_Log.d("-----------------------------------------");
        S_Log.d("[INPUT] : [Header] : "+String.valueOf(requestHeader.toString()));
        S_Log.d("-----------------------------------------");
        S_Log.d("[INPUT] : [Body] : "+String.valueOf(body.toString()));
        S_Log.d("================================================");
        S_Log.d("\n");


        /**
         * // -----------------------------------------
         * [호출 방법]
         * // -----------------------------------------
         * 1. 호출 방식 : PUT
         * // -----------------------------------------
         * 2. 호출 방법 : http://localhost:7000/put_request_test
         * // -----------------------------------------
         * 3. 리턴 데이터 : Y : SUCCESS
         * // -----------------------------------------
         * */


        // [리턴 반환]
        return "Y : SUCCESS";
    }
 

[결과 출력]

 

 

반응형
Comments