Api method is looks like below
[HttpPost] public async Task> MediaBrand(IFormFile file, int brandId)
I have found a workaround to make it work:
Use HttpPut instead of HttPost on the controller action.
HttpPut
HttPost
I was also surprised by this behavior. If someone can explain why it fixes the issue, it would help me.