R.ParseForm() unable to understand it's significance

Hello Everyone,
I have gone through many blogs and sites but unable to understand about this.

func check( R *http.Request){   
 R.parseForm()
// many lines 
}

1.) What does R.ParseFrom do?
2). what is the use of R.ParseForm()
3). If I wont’ write it in the called function what will happen.

It’s in the method documentation:

ParseForm populates r.Form and r.PostForm.

(http package - net/http - Go Packages)

If you use those fields, you need to call this method to ensure they are set. Or use r.FormValue() and other methods which do it automatically.

2 Likes

Thankyou.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.