Go实现http post form表单

go http post form(表单)

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
resp, err := http.PostForm("https://xxx.com/xxx", url.Values{
"x1": {"xxxxxx"},
"x2": {strings.Join(aa, ",")},
"x3": {content}})
if err != nil {
fmt.Println("phoneAlarm request error")
}
defer resp.Body.Close()
resp, err := http.PostForm("https://xxx.com/xxx", url.Values{ "x1": {"xxxxxx"}, "x2": {strings.Join(aa, ",")}, "x3": {content}}) if err != nil { fmt.Println("phoneAlarm request error") } defer resp.Body.Close()
resp, err := http.PostForm("https://xxx.com/xxx", url.Values{
  "x1":   {"xxxxxx"},
  "x2":     {strings.Join(aa, ",")},
  "x3": {content}})
if err != nil {
  fmt.Println("phoneAlarm request error")
}
defer resp.Body.Close()

 

Leave a Reply

Your email address will not be published. Required fields are marked *