I'm trying out go-restful. I found an example here: go example
I try to use curl to post data:
curl -H "Content-Type: text/xml" -X POST -d "<Product><Id>1</Id><Title>The First</Title></Product>" localhost:8080/products
but it didn't work. My questions are:
how to use curl to post data in this example ?
how can this program read xml data into a struct using ?
err := req.ReadEntity(updatedProduct)
(In other examples, req.ReadEntity is able to read json data. How can this single function read data into different structs?)
thanks:)