Skip to content

Instantly share code, notes, and snippets.

@a-h
Created May 24, 2018 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save a-h/defe4a69c1342ed6300ab3bacf366a5c to your computer and use it in GitHub Desktop.
Save a-h/defe4a69c1342ed6300ab3bacf366a5c to your computer and use it in GitHub Desktop.
Webhook Receiver
package main
import (
"fmt"
"net/http"
"net/http/httputil"
)
func main() {
h := handler{}
http.ListenAndServe(":8000", h)
}
type handler struct {
}
func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
dump, err := httputil.DumpRequest(r, true)
if err != nil {
http.Error(w, fmt.Sprint(err), http.StatusInternalServerError)
return
}
fmt.Println(string(dump))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment