Let's say that there are two ways to post data to the same API endpoint, through a file or through he request body.
Is it possible to route to an action by the Accept header for the same resource?
By request body:
// Accept: application/json
[HttpPost]
public IActionResult PostText([FromBody]string text)
{
...
return new HttpOkResult();
}
By file:
// Accept: application/x-www-form-urlencoded
[HttpPost]
public IActionResult PostFile(IFormFile file)
{
...
return new HttpOkResult();
}