完善ghttp客户端示例

This commit is contained in:
John
2018-01-11 17:05:10 +08:00
parent 36ab7a0b05
commit 8da77b8da5
2 changed files with 5 additions and 6 deletions

View File

@ -1,10 +1,9 @@
package demo
import (
"gitee.com/johng/gf/g/os/glog"
"fmt"
"gitee.com/johng/gf/g/os/gfile"
"gitee.com/johng/gf/g/net/ghttp"
"fmt"
)
func Upload(r *ghttp.Request) {
@ -16,7 +15,7 @@ func Upload(r *ghttp.Request) {
gfile.PutBinContents("/tmp/" + fname, buffer)
r.Response.WriteString(fmt.Sprintf("%s upload success, input value:%s", fname, r.GetPostString("name")))
} else {
glog.Error(e)
r.Response.WriteString(e.Error())
}
}