You can have only one parameter with [FromBody]
attribute.
[HttpPost]
[Route("search")]
public HttpResponseMessage Search([FromBody] string term,
[FromBody] string category // this wouldn't work)
{
// Code ommited for brevity.
}
Therefore WebApi expecting you to have key : =dogs
.
So if you would've called it with jQuery - you need to use something like this: $.post('api/test/search', { '': 'dogs' });
Edit:
Resources: