I have been trying to figure this our for the last hour, but I can't see what's wrong with it
the post is from a xamarin app that I'm writing, using restsharp portable client
POST http://192.168.30.103:8080/api/Order HTTP/1.1
Authorization: Basic xxxx
Content-Length: 51
Content-Type: application/json; charset=utf-8
Host: 192.168.30.103:8080
Connection: Keep-Alive
Pragma: no-cache
{"CheckinCount":1,"EventId":16630,"OrderNo":470292}
It hits the server Post API correctly, but the parameter is always null
public IHttpActionResult Post([FromBody]string source) {
dynamic data = JsonConvert.DeserializeObject(source);
int checkInCount = data.CheckinCount;
int eventId = data.EventId;
int orderNo = data.OrderNo;
return Ok();
}
I can't figure out why...