Created
May 17, 2022 03:24
-
-
Save shurane/12647ca82912a920034e505a84cee1c8 to your computer and use it in GitHub Desktop.
This file contains 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" | |
"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)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment