1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 12:30:54 +00:00
This commit is contained in:
astaxie 2016-01-04 22:41:25 +08:00
parent 3bb22d149e
commit 5c18d02b17

View File

@ -82,7 +82,7 @@ func NewBeegoRequest(rawurl, method string) *BeegoHTTPRequest {
var resp http.Response var resp http.Response
u, err := url.Parse(rawurl) u, err := url.Parse(rawurl)
if err != nil { if err != nil {
log.Fatal(err) log.Println("Httplib:", err)
} }
req := http.Request{ req := http.Request{
URL: u, URL: u,
@ -334,17 +334,17 @@ func (b *BeegoHTTPRequest) buildURL(paramBody string) {
for formname, filename := range b.files { for formname, filename := range b.files {
fileWriter, err := bodyWriter.CreateFormFile(formname, filename) fileWriter, err := bodyWriter.CreateFormFile(formname, filename)
if err != nil { if err != nil {
log.Fatal(err) log.Println("Httplib:", err)
} }
fh, err := os.Open(filename) fh, err := os.Open(filename)
if err != nil { if err != nil {
log.Fatal(err) log.Println("Httplib:", err)
} }
//iocopy //iocopy
_, err = io.Copy(fileWriter, fh) _, err = io.Copy(fileWriter, fh)
fh.Close() fh.Close()
if err != nil { if err != nil {
log.Fatal(err) log.Println("Httplib:", err)
} }
} }
for k, v := range b.params { for k, v := range b.params {