【已完结】

 

body, err := ioutil.ReadAll(r.Body)
if err != nil {
    log.Printf("FATAL IO reader issue %s ", err.Error())
}
curl --data '{"AppName":"Proline","Properties":null,"Object":"","Timestamp":"2016:03:27 00:08:11"}' -XGET http://localhost:8081/api/services/test/
requestJSON = '{"AppName":"Proline","Properties":null,"Object":"","Timestamp":"2016:03:27 00:08:11"}'
$.ajax({
  type: "GET",
  url: "http://localhost:8081/api/services/test/",
  data: requestJSON,
  contentType: "application/json; charset=utf-8",
  dataType: "json",
  success: function(data){alert(data);},
  failure: function(errMsg) {
      alert(errMsg);
  }
});
r.ParseForm()
var body []byte
for key, _ := range r.Form {
    body = []byte(key)
    break
}