2020
12-18
12-18
go Http Post 发送文件流案例
我就废话不多说了,大家还是直接看代码吧~packagemainimport("net/http""net/url""fmt""io/ioutil"_"io""bytes")funcmain(){postFile()}funcpost(){//这是一个Post参数会被返回的地址strinUrl:="http://localhost:8080/aaa"`这里写代码片`resopne,err:=http.PostForm(strinUrl,url.Values{"num":{"456"},"num1":{"123"}})iferr!=nil{fmt.Println("err=",err)}deferfunc(){resopne.Body.Clos...
继续阅读 >