Created
July 9, 2020 23:15
-
-
Save miguelmota/c88d6a7750cf2dab20f9a5d43f6b81c4 to your computer and use it in GitHub Desktop.
Golang disable request chunked transfer encoding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// explicity setting the content-length will disable the "transfer-encoding: chunked" header | |
req.ContentLength = int64(len(requestBody)) | |
// you can also remove the transfer-encoding header with this, | |
// however setting the content-length header is still required. | |
req.TransferEncoding = []string{"identity"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment