1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-22 18:40:49 +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
u, err := url.Parse(rawurl)
if err != nil {
log.Fatal(err)
log.Println("Httplib:", err)
}
req := http.Request{
URL: u,
@ -334,17 +334,17 @@ func (b *BeegoHTTPRequest) buildURL(paramBody string) {
for formname, filename := range b.files {
fileWriter, err := bodyWriter.CreateFormFile(formname, filename)
if err != nil {
log.Fatal(err)
log.Println("Httplib:", err)
}
fh, err := os.Open(filename)
if err != nil {
log.Fatal(err)
log.Println("Httplib:", err)
}
//iocopy
_, err = io.Copy(fileWriter, fh)
fh.Close()
if err != nil {
log.Fatal(err)
log.Println("Httplib:", err)
}
}
for k, v := range b.params {