package main
import (
"fmt"
"strings"
"io/ioutil"
"net/http"
)
func httpPost() {
resp, err := http.Post("http://www.xxxx.com/api/httpdclient2/","application/x-www-form-urlencoded", strings.NewReader("id=test&data=ab123123"))
if err != nil {
fmt.Println(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
// handle error
}
fmt.Println(string(body))
}
func main() {
httpPost()
}
如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!
txttool.com 说一段 esp56物联 查询128 IP查询