go http.Response返回json数据

resp := &http.Response{
    StatusCode: 200,
    ProtoMajor: 1,
    ProtoMinor: 1,
    Header:     http.Header{"Content-Type": []string{"text/plain"}},
    Body:       ioutil.NopCloser(strings.NewReader("Hello, World!")),
}

你可能感兴趣的:(golang,http,后端)