I'm developing an Ionic 3 mobile application and using ASP.NET REST WebAPI 2 as my back-end.
I've been trying to pass a base64 string ( around 150kb big enocoded png image) to one of my webAPI methods without any success for the last couple of days.
Method that I'm calling in my WebAPI
The problem is that the WebApi doesn't seem to receive any values, as seen HERE
I'm sending my data with these HEADERS
Upon further inspection I noticed the following. I intercepted the api call with Postman and discovered that the webApi receives data, but cuts the data at 4079th character as seen HERE. Since the webAPI seems to cut the JSON string at 4079th character, the JSON itself isn't complete which (I'm guessing) is the reason why the webAPI can't read it and also why the values are all empty while debugging the webAPI method in Visual Studio.
Here is another interesting thing. In Chrome Development tools under the Network section I can see the API call with all the additional info. Chrome also shows the FULL base64 string as seen HERE.
Does anyone have any idea what's going on here? Has anyone else experienced similar problems before?
UPDATE 1:
I just added THIS to my Web.config as @evayly suggested.
I also tried adjusting the following values:
maxAllowedContentLength
maxRequestLength
aspnet:MaxJsonDeserializerMembers
but it didn't solve the problem.
UPDATE 2
Another part of interesting info:
If I manually edit the intercepted post in Postman by adding json closing tags - " } and resend it, the method reads the data without any problems. So i think the main problem is something cutting my json to 4079 characters --> creating a json string without the proper closing tags and thus making my json invalid.