From c255a257c3956f29d27643e7c0d013abbd71a5c5 Mon Sep 17 00:00:00 2001 From: lzf Date: Fri, 11 Jul 2025 17:11:28 +0800 Subject: [PATCH] update --- myhttp/httpc/httpclient.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/myhttp/httpc/httpclient.go b/myhttp/httpc/httpclient.go index 0b5c1ea..8771373 100644 --- a/myhttp/httpc/httpclient.go +++ b/myhttp/httpc/httpclient.go @@ -216,7 +216,10 @@ func (r *Request) Do(method, rawUrl string) (*Response, error) { req.URL.RawQuery = query.Encode() - req.Header.Set("Content-Type", r.contentType) + if r.contentType != "" { + req.Header.Set("Content-Type", r.contentType) + } + for k := range r.header { req.Header.Set(k, r.header.Get(k)) }