Golang Read POST Form Values

The example below uses gorilla/mux package

package main

import (
"fmt"
"log"
"net/http"
"github.com/gorilla/mux"
)

func YourHandler(w http.ResponseWriter, r *http.Request) {
r.ParseForm()
log.Println("one=" + r.FormValue("one"))
log.Println("two=" + r.FormValue("two"))
fmt.Fprintf(w, "Gorilla!\n")
}

func main() {
r := mux.NewRouter()
r.HandleFunc("/", YourHandler).Methods("POST")
log.Fatal(http.ListenAndServe(":8000", r))
}

With the codes above, try posting a form with curl or postman

curl -X POST --data…