Skip to content

Commit 5209915

Browse files
authored
fix:当有--data-raw选项的时候,method应该是post (#22)
1 parent c664cb4 commit 5209915

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pcurl.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@ func (c *Curl) setMethod() {
206206
return
207207
}
208208

209-
if len(c.Data) > 0 {
209+
// 支持--data-raw选项,改成POST方式
210+
if len(c.Data) > 0 || len(c.DataRaw) > 0 {
210211
c.Method = "POST"
211212
return
212213
}

0 commit comments

Comments
 (0)