From 8dc8dd97569c1309726b094ecea906d7f42418c4 Mon Sep 17 00:00:00 2001 From: HaiLaz <739476267@qq.com> Date: Mon, 20 Feb 2023 21:57:49 +0800 Subject: [PATCH] fix issue #2261 (#2458) --- net/ghttp/ghttp_request_param.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ghttp/ghttp_request_param.go b/net/ghttp/ghttp_request_param.go index 7f96883c0..bf748c9ba 100644 --- a/net/ghttp/ghttp_request_param.go +++ b/net/ghttp/ghttp_request_param.go @@ -240,7 +240,7 @@ func (r *Request) parseBody() { r.bodyMap, _ = gxml.DecodeWithoutRoot(body) } // Default parameters decoding. - if r.bodyMap == nil { + if contentType := r.Header.Get("Content-Type"); (contentType == "" || !gstr.Contains(contentType, "multipart/")) && r.bodyMap == nil { r.bodyMap, _ = gstr.Parse(r.GetBodyString()) } }