Skip to content

Commit

Permalink
fix:当有--data-raw选项的时候,method应该是post (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
testerzhang authored Apr 23, 2024
1 parent c664cb4 commit 5209915
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pcurl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 5209915

Please sign in to comment.