From 12c13f9cc8ec81128b49c1e0351b5f76ee431147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=AE=87?= <940643974@qq.com> Date: Mon, 4 Dec 2023 22:26:55 +0800 Subject: [PATCH] fix the json param convert --- .../main/java/org/apache/hugegraph/rest/AbstractRestClient.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java b/hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java index 00662bf1..973f177d 100644 --- a/hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java +++ b/hugegraph-common/src/main/java/org/apache/hugegraph/rest/AbstractRestClient.java @@ -127,6 +127,8 @@ private static RequestBody buildRequestBody(Object body, RestHeaders headers) { if (RestHeaders.APPLICATION_JSON.equals(contentType)) { if (body == null) { bodyContent = "{}"; + } else if (body instanceof String) { + bodyContent = (String) body; } else { bodyContent = JsonUtilCommon.toJson(body); }