Created
March 12, 2016 09:45
-
-
Save eternnoir/c2dd68e2ddb8ab7c1533 to your computer and use it in GitHub Desktop.
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" | |
"io/ioutil" | |
"log" | |
"net/http" | |
) | |
type test_struct struct { | |
Test string | |
} | |
func test(rw http.ResponseWriter, req *http.Request) { | |
body, err := ioutil.ReadAll(req.Body) | |
if err != nil { | |
return | |
} | |
fmt.Println("==================================") | |
fmt.Println(string(body)) | |
} | |
func main() { | |
http.HandleFunc("/test", test) | |
log.Fatal(http.ListenAndServe(":8082", nil)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment