mirror of
https://github.com/astaxie/beego.git
synced 2024-11-26 03:21:29 +00:00
fix #1268
This commit is contained in:
parent
3bb22d149e
commit
5c18d02b17
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user