net/http: make Request.Form.Get call ParseForm automatically #24338
Comments
How exactly would this work? |
This functionality is already implemented in one way as
Go 2 net/http improvements: #5465 |
Ah, I didn't know about |
Go2 changes are already being tracked in another issue, so I'm going to close this one. Exposing the same method under two names is a bad idea in my opinion; especially since Go tends to not like getters: https://golang.org/doc/effective_go.html#Getters |
req.ParseForm()
is needed to be called before accessing the form parameters usingparam := req.Form.Get("param-name")
where req is a http.RequestIs there a reason behind this?
I would like to add a feature to ParseForm automatically from Form.Get() on first execution and on next calls, check if Form is already parsed and work as usual.
What are your thoughts?
The text was updated successfully, but these errors were encountered: