IFormFile is always null when receiving file from console app
问题 I have my WebApi method ready to accept file as parameter shown below: (e.g. uri "https://localhost:44397/api/uploadfile" [Route("api/[controller]")] [ApiController] public class UploadFileController : ControllerBase { [HttpPost] public async Task<IActionResult> Post([FromForm] IFormFile file) { } } Am using console app to send file to this api method, below is my code: public static void Send(string fileName) { using (var client = new HttpClient()) using (var content = new