Skip to content

api: pass in body to NewRequestWithContext#263

Merged
keegancsmith merged 1 commit into
masterfrom
k/content-length
Aug 14, 2020
Merged

api: pass in body to NewRequestWithContext#263
keegancsmith merged 1 commit into
masterfrom
k/content-length

Conversation

@keegancsmith

Copy link
Copy Markdown
Member

By directly passing in the body we will also get the ContentLength
header set.

Minor: we avoid the extra buffer than json.NewEncoder uses, and isntead
directly get the buffer from json.Marshal.

By directly passing in the body we will also get the ContentLength
header set.

Minor: we avoid the extra buffer than json.NewEncoder uses, and isntead
directly get the buffer from json.Marshal.
@keegancsmith keegancsmith requested a review from LawnGnome August 13, 2020 11:42

@LawnGnome LawnGnome left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it! The perils of copy/pasting blindly when refactoring.

Thanks! 👍

@keegancsmith keegancsmith merged commit 12fba59 into master Aug 14, 2020
@keegancsmith keegancsmith deleted the k/content-length branch August 14, 2020 17:51
scjohns pushed a commit that referenced this pull request Apr 24, 2023
By directly passing in the body we will also get the ContentLength
header set.

Minor: we avoid the extra buffer than json.NewEncoder uses, and instead
directly get the buffer from json.Marshal.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants