mirror of
https://github.com/astaxie/beego.git
synced 2024-11-26 04:51:30 +00:00
httplib support delete params fix #2593
This commit is contained in:
parent
d03285a0ee
commit
3742d1178c
@ -344,7 +344,7 @@ func (b *BeegoHTTPRequest) buildURL(paramBody string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// build POST/PUT/PATCH url and body
|
// build POST/PUT/PATCH url and body
|
||||||
if (b.req.Method == "POST" || b.req.Method == "PUT" || b.req.Method == "PATCH") && b.req.Body == nil {
|
if (b.req.Method == "POST" || b.req.Method == "PUT" || b.req.Method == "PATCH" || b.req.Method == "DELETE") && b.req.Body == nil {
|
||||||
// with files
|
// with files
|
||||||
if len(b.files) > 0 {
|
if len(b.files) > 0 {
|
||||||
pr, pw := io.Pipe()
|
pr, pw := io.Pipe()
|
||||||
|
@ -102,6 +102,14 @@ func TestSimpleDelete(t *testing.T) {
|
|||||||
t.Log(str)
|
t.Log(str)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestSimpleDeleteParam(t *testing.T) {
|
||||||
|
str, err := Delete("http://httpbin.org/delete").Param("key", "val").String()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
t.Log(str)
|
||||||
|
}
|
||||||
|
|
||||||
func TestWithCookie(t *testing.T) {
|
func TestWithCookie(t *testing.T) {
|
||||||
v := "smallfish"
|
v := "smallfish"
|
||||||
str, err := Get("http://httpbin.org/cookies/set?k1=" + v).SetEnableCookie(true).String()
|
str, err := Get("http://httpbin.org/cookies/set?k1=" + v).SetEnableCookie(true).String()
|
||||||
|
Loading…
Reference in New Issue
Block a user