0

I'm trying to send a large stringfy'ed JSON list array to a C# function using AngularJS

POST:

$http(
     {
          method: "POST",
          url: "/Home/IntegrityCheck",
          dataType: 'json',
          data: { bulkUpdateList: JSON.stringify(bulkUpdate) },
          headers: { "Content-Type": "application/json" }
      }).then(function (result) {

JSON example:

[{"ApplicationNo":"WHD00004925","field":"Decision","newValue":"Approved","idUser":"1"},
{"ApplicationNo":"WHD00005030","field":"AccountNumber","newValue":"100070","idUser":"1"}]

This works for up-to ~15,000 rows, but anything over and it instantly gives the following in the browser console...

angular.js:12845 POST http://localhost:50869/Home/IntegrityCheck 500 (Internal Server Error)

The C# function is never hit when the array is over a certain size (I've not been able to pin down the exact size it fails at, but is around 16,000+) the post will need to handle arrays of a max length of 450,000 rows.

My understanding is the max string I could send via post is something like 2 billion characters or 2GB in size, neither of which I'm getting remotely close to. I don't seem to have anything in my webconfig which would limit post messages to a controller.

EDIT... (stil doesn't work)

We're using IIS10 and Azure

I've updated my web config with...

<system.web>
    <httpRuntime maxRequestLength="1048576" /> 
</system.web>

<appSettings>
    <add key="aspnet:MaxJsonDeserializerMembers" value="2147483644" /> 
</appSettings>

<requestFiltering>
    <requestLimits maxAllowedContentLength="1073741824" />
</requestFiltering>
7
  • What is the length of the largest JSON string that works (approximately)? The smallest JSON string that doesn't work (approximately)? Commented Oct 18, 2018 at 11:42
  • Check this: stackoverflow.com/questions/16287706/… Commented Oct 18, 2018 at 11:46
  • If you use nginx or other web server, remember to set client_max_body_size or equivalent option as well, for some configurations the default is 10 megs, which is nowhere near enough for 450k rows. Commented Oct 18, 2018 at 11:48
  • See this : stackoverflow.com/questions/52655444/… Commented Oct 18, 2018 at 11:50
  • 1
    This is what you're looking for: stackoverflow.com/a/3853785/3390570 Commented Oct 18, 2018 at 11:57

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.