Reputation: 5213
I am trying to call following function (asp.net web api core) from PostMan:
[HttpPost]
public InfluencerSearchResultWithFacets Post(string q, string group, List<string> subGroups)
{
return GetSearchResult("",null,null);
}
But I get following error: A non-empty request body is required
I have setup PostMan like this:
Upvotes: 7
Views: 16259
Reputation: 24569
So you can create a model like
public class Model
{
public string q { get; set; }
public string group { get; set; }
public List<string>subGroups { get; set; }
}
and use it
[HttpPost]
public InfluencerSearchResultWithFacets Post([FromBody] Model model)
{
return GetSearchResult("",null,null);
}
This is if you fit Json format. Also you can leave some parameters in URL and other pass as a body like
[HttpPost]
public InfluencerSearchResultWithFacets Post([FromUri]string q, [FromUri]string group, [FromBody]List<string> subGroups)
{
return GetSearchResult("",null,null);
}
Upvotes: 8