Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Post request Go web server
package main
import (
func postRoute(rw http.ResponseWriter, req *http.Request) {
body, err := ioutil.ReadAll(req.Body)
if err != nil {
// further handle request
func main() {
http.HandleFunc("/postRoute", postRoute)
log.Fatal(http.ListenAndServe(":8080", nil))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment