Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proposal: net/http: http.ResponseWriter add GetBody() and StatusCode() #52256

Closed
hyahm opened this issue Apr 10, 2022 · 2 comments
Closed

proposal: net/http: http.ResponseWriter add GetBody() and StatusCode() #52256

hyahm opened this issue Apr 10, 2022 · 2 comments

Comments

@hyahm
Copy link

hyahm commented Apr 10, 2022

Define a public variable and set the maximum length for GetBody()
In this way, Can get the returned data and status code at the end to facilitate logging

@hyahm hyahm added the Proposal label Apr 10, 2022
@gopherbot gopherbot added this to the Proposal milestone Apr 10, 2022
@ianlancetaylor ianlancetaylor changed the title proposal: affected/package: net/http http.ResponseWriter add GetBody() and StatusCode() proposal: net/http: http.ResponseWriter add GetBody() and StatusCode() Apr 10, 2022
@ianlancetaylor
Copy link
Contributor

I'm sorry, I don't know what you mean by "a public variable."

Note that we can't add new methods to the ResponseWriter interface, as that would break the Go 1 compatibility guarantee.

@hyahm
Copy link
Author

hyahm commented Apr 10, 2022

Like r.ParseMultipartForm(32 << 20) to set max get body

Thank you for your reply

@hyahm hyahm closed this as completed Apr 10, 2022
@golang golang locked and limited conversation to collaborators Apr 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants