//Post("http://xxxx","application/json;charset=utf-8",[]byte("{'aaa':'bbb'}")) func Post(url string,contentType byte) (string,error) { res,err := http.Post(url,contentType,strings.NewReader((body))) if err != nil { return "" IoUtil.ReadAll(res.Body) return (content),nil }
发送一个JSON类型的请求
Post("http://xxxx",[]byte("{'aaa':'bbb'}"))