We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
How to extract data from POST requests ?
Thanks
The text was updated successfully, but these errors were encountered:
Hi @gallart here is a small example, but may be worth for you to check the net/http docs https://golang.org/pkg/net/http/, violetear doesn't modify/changes the *http.Request behavior:
*http.Request
package main import ( "fmt" "log" "net/http" "github.com/nbari/violetear" ) func handler(w http.ResponseWriter, r *http.Request) { r.ParseForm() x := r.Form.Get("foo") fmt.Println(x) } func main() { router := violetear.New() router.HandleFunc("*", handler, "POST") // catchall request but only accept POST method log.Fatal(http.ListenAndServe(":8080", router)) }
Then from the command line:
curl -d "foo=bar" -X POST http://localhost:8080
Sorry, something went wrong.
No branches or pull requests
Hi,
How to extract data from POST requests ?
Thanks
The text was updated successfully, but these errors were encountered: