Created
May 24, 2018 14:40
-
-
Save a-h/defe4a69c1342ed6300ab3bacf366a5c to your computer and use it in GitHub Desktop.
Webhook Receiver
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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