Skip to content

Instantly share code, notes, and snippets.

@eternnoir
Created March 12, 2016 09:45
Show Gist options
  • Save eternnoir/c2dd68e2ddb8ab7c1533 to your computer and use it in GitHub Desktop.
Save eternnoir/c2dd68e2ddb8ab7c1533 to your computer and use it in GitHub Desktop.
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