golang接收post接收xml或者json数据

import (
	"fmt"
	"io/ioutil"
	"net/http"
)

func main() {
	http.HandleFunc("/", myHandle)
	http.ListenAndServe(":8888", nil)
}

func myHandle(w http.ResponseWriter, r *http.Request) {
	defer r.Body.Close()
	con, _ := ioutil.ReadAll(r.Body) //获取post的数据
	fmt.Println(string(con))

}
原文地址:https://www.cnblogs.com/enumx/p/12315600.html