Morasiu's project is taken as a basis.
The main difference from the original source is reading the json body from Request.Form.Files.
- Simple add this to your ConfigureServices
services.AddJsonMultipartFormDataSupport(JsonSerializerChoice.SystemText);- Create your wrapper
public class MyWrapper
{
[Required]
public IFormFile File { get; set; } = null!;
[FromJson, Required]
public MyJson Json { get; set; } = null!;
}and then add to your controller
[HttpPost]
public IActionResult Post([FromForm] MyWrapper request)
{
return this.Ok();
}