From dcf37525153c87ba31106e35f9866f94a5977913 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=AE=87?= <940643974@qq.com> Date: Tue, 5 Dec 2023 10:56:12 +0800 Subject: [PATCH] fix the json param convert (#137) --- .../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); }