json 请求

client := &http.Client{}
data := make(map[string]interface{})
data["key_name"] = key_name
data["value_name"] = key_value
bytesData, _ := json.Marshal(data)
req, _ := http.NewRequest("POST", "http://url", bytes.NewReader(bytesData))
req.Header.Set("Content-Type", "application/json")
resp, _ := client.Do(req)
defer resp.Body.Close()

body, _ := ioutil.ReadAll(resp.Body)
log.Println(string(body))