client := &http.Client{]
req, err := http.NewRequest("POST", "http://example.com", strings.NewReader(postData))
req.Header.Add("User-Agent", "myClient")
resp, err := client.Do(req)
defer resp.Body.Close()
client := &http.Client{]
req, err := http.NewRequest("POST", "http://example.com", strings.NewReader(postData))
req.Header.Add("User-Agent", "myClient")
resp, err := client.Do(req)
defer resp.Body.Close()
本文标题:golang http post set headers
本文链接:https://www.haomeiwen.com/subject/njdeuqtx.html
网友评论