httplib:support file upload
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
package httplib
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"testing"
|
||||
)
|
||||
@@ -36,3 +37,15 @@ func TestGetUrl(t *testing.T) {
|
||||
t.Fatal("has no info")
|
||||
}
|
||||
}
|
||||
|
||||
func TestPost(t *testing.T) {
|
||||
b := Post("http://beego.me/").Debug(true)
|
||||
b.Param("username", "astaxie")
|
||||
b.Param("password", "hello")
|
||||
b.PostFile("uploadfile", "httplib.go")
|
||||
str, err := b.String()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
fmt.Println(str)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user