From 830d07c23dc722557b63bc9e27f2fe53c8ab482f Mon Sep 17 00:00:00 2001 From: Cold <16419454+cold502@user.noreply.gitee.com> Date: Tue, 13 Jan 2026 10:16:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ragflow/client.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ragflow/client.go b/ragflow/client.go index 24a426a..41c7681 100644 --- a/ragflow/client.go +++ b/ragflow/client.go @@ -120,6 +120,7 @@ func (r *CommonResponse) IsSuccess() bool { // request 发送 HTTP 请求 // // 为什么不使用 common/http 包: +// // 1. common/http/http.go:61 会用内部请求的Authorization覆盖RAGFlow API key: // Httpclient.SetHeader("Authorization", g.RequestFromCtx(ctx).GetHeader("Authorization")) // 这会导致RAGFlow API认证失败,因为内部token不是RAGFlow的API key @@ -162,7 +163,12 @@ func (c *Client) request(ctx context.Context, method, path string, body interfac case "PUT": response, err = client.Put(ctx, fullURL, body) case "DELETE": - response, err = client.Delete(ctx, fullURL, body) + // DELETE请求需要明确使用ContentJson发送body + if body != nil { + response, err = client.ContentJson().Delete(ctx, fullURL, body) + } else { + response, err = client.Delete(ctx, fullURL) + } default: return gerror.Newf("unsupported method: %s", method) }