I'm rather new in golang, but I'm trying hard..
I'm trying to send json by post request to the revel controller, and parse it on the revel side.
But while getting the result I cannot Unmarshal it... I'm sending an array
json_encode(array("one","two","three"))
But I can't find the correct way to work with such a data. I'm not sure do I need to make json before sending it or not..
func (c KpiCtrl) GetData() revel.Result {
content, _ := ioutil.ReadAll(c.Request.Body)
...
return c.RenderJson(content)
}
returns
"WyJvbmUiLCJ0d28iLCJ0aHJlZSJd"
I tried to use json.Unmarshal but it returns errors.. What is the best practice to work with post data sent by curl to revel controller?