Golang 设置 http response 响应头的坑
Golang http set response header
设置WriteHeader的顺序问题 写grpc proxy gateway的时候遇到一个问题,在代码中这样设置WriteHeader,最后在response header中获取到的Content-Type却是 text/plain; charset=utf-8; 可见设置header是失败的: 1 2 3 writer.WriteHeader(http.StatusOK) writer...