Tuesday, April 16, 2019

'((Microsoft.AspNetCore.Http.Internal.DefaultHttpRequest)request).Form' threw an exception of type 'System.IO.InvalidDataException'

And exception was: System.IO.InvalidDataException: 'Missing content-type boundary.' Alright, I was getting this in an Angular 7 application attempting to do this stuff and talk to a .NET Core 2.1 API. I had already modified what was by removing the .catch as described here, and I had to make two more modifications to get around this second problem:

  1. I removed this line:
    headers.append('Content-Type', 'multipart/form-data');
     
  2. I changed the action's method signature like so:
    public void SaveStuff(IFormFile uploadFile)
    {

     

I tried changing multipart/form-data to application/x-www-form-urlencoded before I got this working and instead got this error:

The function evaluation requires all threads to run.

No comments:

Post a Comment