From 5209915832dc0779731d6f36bf893199394bd2db Mon Sep 17 00:00:00 2001 From: testerzhang <66997457+testerzhang@users.noreply.github.com> Date: Tue, 23 Apr 2024 12:58:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=BD=93=E6=9C=89--data-raw=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8Cmethod=E5=BA=94?= =?UTF-8?q?=E8=AF=A5=E6=98=AFpost=20(#22)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pcurl.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pcurl.go b/pcurl.go index 18174f8..a1605b0 100644 --- a/pcurl.go +++ b/pcurl.go @@ -206,7 +206,8 @@ func (c *Curl) setMethod() { return } - if len(c.Data) > 0 { + // 支持--data-raw选项,改成POST方式 + if len(c.Data) > 0 || len(c.DataRaw) > 0 { c.Method = "POST" return }