Avatar ·

In Go http package, how to get query string in POST request?

Hello everyone! I recently started learning Go and encountered a problem while working with an HTTP server. I need to handle a POST request where the client passes parameters both in the query string (URL) and in the request body (form-data). Here's an example of my code: ```go func handlePost(w http.ResponseWriter, r *http.Request) { if r.Method != http.MethodPost { http.Error(w, "Method not allowed", http.StatusMethodNotAllowed) return } // Trying to get parameters from query string name := r.URL.Query().Get("name") age := r.URL.Query().Get("age") // And from the request body r.ParseForm() email := r.FormValue("email") log.Printf("Name: %s, Age: %s, Email: %s", name, age, email) } ``` The problem is that when I send a POST re