Skip to content

Populate GetBody() with custom option to allow for retries#15

Merged
morgangallant merged 4 commits intomainfrom
mg/get-body
Aug 13, 2025
Merged

Populate GetBody() with custom option to allow for retries#15
morgangallant merged 4 commits intomainfrom
mg/get-body

Conversation

@morgangallant
Copy link
Collaborator

@morgangallant morgangallant commented Aug 12, 2025

Allows for retries by reconstructing the body io.Reader if needed. Doing it this way means we don't need to allocate any additional memory, and we can properly re-use the slice.

Signed-off-by: Morgan Gallant <morgan@morgangallant.com>
@morgangallant morgangallant requested a review from utaal August 12, 2025 20:02
Signed-off-by: Morgan Gallant <morgan@morgangallant.com>
@morgangallant morgangallant requested a review from benesch August 12, 2025 23:11
@morgangallant morgangallant changed the title allow http.Request.GetBody() to be populated by stainless Populate GetBody() with custom option to allow for retries Aug 12, 2025
Copy link
Contributor

@benesch benesch left a comment

Choose a reason for hiding this comment

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

Nice. Looks good to me.

@morgangallant morgangallant merged commit 88eceac into main Aug 13, 2025
1 check passed
@morgangallant morgangallant deleted the mg/get-body branch August 13, 2025 14:34
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.

3 participants

Comments