I want to send my response data to to client with "Transfer-Encoding:trunked". But I do not find the way to do it with Golang. Is there any example for this?
1 Answer
The net/http server does not allow the application to control the transfer encoding.
The net/http server automatically uses chunked encoding when the application does not set the Content-Length response header and the connection can be reused (http/1 client requested keep-alive or http/1.1 client did not request connection close).
2 Comments
yinchunxiang
when server automatically uses chunked encoding, what
yinchunxiang
thanks, and one more question. What is the default content-length when server uses chunked encoding automatically.