Reputation: 1037
When i test following API using fiddler always set the parameter myRequest with null value. how i can fix this?
API
public HttpResponseMessage Post([FromBody]MyRequest myRequest)
{
}
Model
public class MyRequest
{
public int[] MyId { get; set; }
}
Fiddler Test
http://localhost:4037/api/PostTest
Request Body
{
"MyRequest": {
"MyId": [
1,
2
]
}
}
Upvotes: 0
Views: 120
Reputation: 37520
You don't need "MyRequest" in the JSON...
{
"MyId": [
1,
2
]
}
Upvotes: 1