0

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 1

1

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).

Sign up to request clarification or add additional context in comments.

2 Comments

when server automatically uses chunked encoding, what
thanks, and one more question. What is the default content-length when server uses chunked encoding automatically.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.