From 0dc90ed6ccc594464a56a77548c9e594bfeab55f Mon Sep 17 00:00:00 2001 From: mjkhan21 Date: Tue, 24 Oct 2023 17:40:57 +0900 Subject: [PATCH] =?UTF-8?q?header(Map)=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/cokr/xit/foundation/web/WebClient.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/cokr/xit/foundation/web/WebClient.java b/src/main/java/cokr/xit/foundation/web/WebClient.java index ac66992..9c94059 100644 --- a/src/main/java/cokr/xit/foundation/web/WebClient.java +++ b/src/main/java/cokr/xit/foundation/web/WebClient.java @@ -315,6 +315,16 @@ public class WebClient { return this; } + /**map의 엔트리로 요청의 헤더를 설정한다. + * @param map map + * @return 현재 Request + */ + public Request header(Map map) { + if (!Assert.isEmpty(map)) + map.forEach(this::header); + return this; + } + public Request contentType(ContentType type) { return header("Content-Type", type.type + "; charset=" + charset); }