package main import ( "fmt" "github.com/ant0ine/go-json-rest/rest" "net/http" ) func main() { api := rest.NewApi() api.Use(rest.DefaultDevStack...) router, err := rest.MakeRouter( rest.Post("/users", CreateUser), ) if err != nil { fmt.Println(err) } api.SetApp(router) http.ListenAndServe(":8080", api.MakeHandler()) } type User struct { Name string `json:"name"` Email string `json:"email"` Password string `json:"password"` } func CreateUser(w rest.ResponseWriter, r *rest.Request) { user := User{} user.Name = r.FormValue("name") user.Email = r.FormValue("email") user.Password = r.FormValue("password") // create user w.WriteHeader(http.StatusCreated) }In this example, we define a REST endpoint `/users` using the `rest.Post` method. When a POST request is made to this endpoint, the `CreateUser` function is called with the `rest.ResponseWriter` and `rest.Request` objects as parameters. Using the `r.FormValue` function, we extract the values of the `name`, `email`, and `password` form fields from the request and create a `User` object. This example demonstrates the use of Request.FormValue to extract form data from an HTTP request. Package library: github.com/ant0ine/go-json-rest