package main import ( "encoding/json" "fmt" "net/http" "log" ) type Data struct { identifier string password string } func handleRequest(w http.ResponseWriter, r *http.Request) { var data Data err := json.NewDecoder(r.Body).Decode(&data) if err != nil { http.Error(w,err.Error(), http.StatusBadRequest) return } fmt.Fprintf(w, "Data: %+v", data) } func main() { http.HandleFunc("/", handleRequest) log.Fatal(http.ListenAndServe(":8088", nil)) }