Created
May 17, 2022 03:24
-
-
Save shurane/12647ca82912a920034e505a84cee1c8 to your computer and use it in GitHub Desktop.
Revisions
-
shurane created this gist
May 17, 2022 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ package main import ( "fmt" "html" "log" "net/http" ) func main() { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { // r.ParseMultipartForm() r.ParseForm() for k, v := range r.PostForm { log.Print("PostForm Key: ", k) log.Println("Value: ", v) } fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path)) }) log.Println("Listening on localhost:8080") log.Fatal(http.ListenAndServe(":8080", nil)) }