res, _ := client.Do(req)
defer res.Body.Close()
res_body, _ := ioutil.ReadAll(res.Body)
fmt.Print(string(res_body))
//res_body是post请求后的返回JSON字符串 见https://mp.csdn.net/console/editor/html/108704600
/*Indent*/
var out bytes.Buffer
err := json.Indent(&out, res_body, "", "\t")
if err != nil {
fmt.Print("err")
}
/*Create*/
writeToFile(string(out.Bytes()), filename)