I have successfully added and used a Get action in my new REST-service in .Net using WCF and the Rest-toolkit. The service is defined like this:
[OperationContract]
[WebGet(UriTemplate = "/{id}")]
Foo GetFooById(string id);
And I call it like this from the client side:
public Foo GetFoo(string id)
{
var httpClient = new HttpClient("http://127.0.0.1:8000/");
var response = httpClient.Get("foo/" + id);
return response.Content.ReadAsDataContract<Foo>();
}
Now I want to add a POST action, but how do you define it, and how do you map the parameters?