Given the following code and config for OpenRasta :
ResourceSpace.Has.ResourcesOfType<Foo>()
.AtUri("/foo/{fooID}")
.And.AtUri("/foo")
.HandledBy<FooHandler>()
.AsJsonDataContract();
public OperationResult GetFoo(int fooID) { }
public OperationResult PostFoo(Foo foo) { }
public class Foo
{
public int ID { get; set; }
public string Name { get; set; }
}
What is the correct format for the body of the request if I want to post to the PostFoo method on my FooHandler. Can it be json (i.e. the same format I would recieve from GetFoo) or should it be name-value pairs (e.g. ID=1&Name=FooManChu) ?
Do I need to set any additional headers in the post request such as content type ?
I am trying to get this working but I seem to be getting 415 errors when I try to do this ?