Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSON limitation?

I would like to know if JSON with AJAX has a limitation to the amount of data an outgoing and returning parameter can carry?

I would like to be able to send and return from the server a file with 10,000 lines, as a string. How should I achieve this task? Will a single parameter will be able to hand this?

EDIT: My client is JavaScript and my server PHP.

Thank you.

like image 493
thedp Avatar asked Apr 01 '10 18:04

thedp


People also ask

Does JSON Parse have a limit?

The Limitations of Parse JSONPower Automate has a usage limit of 5,000 API requests. Reading the licensing information clarifies that this doesn't mean you can run the flow 5,000 times because the software system considers every flow action as an API request.

Can JSON store long?

But the JSON spec is quite clear that JSON numbers are unlimited size.

Is JSON more secure than XML?

Key Difference Between JSON and XMLJSON is less secured whereas XML is more secure compared to JSON. JSON supports only UTF-8 encoding whereas XML supports various encoding formats.


2 Answers

JSON does not inherently have a limit as to the amount of data it can transmit or a limit on its recursion depth. This depends on your application server.

If you're using JSONSerialization with C#, the limit on the amount of data is set to pretty low. You can overwrite that by putting the following code snippet in your Web.config.


<system.web.extensions>
        <scripting>
            <webServices>
                <jsonSerialization maxJsonLength="2147483644"></jsonSerialization>
            </webServices>
        </scripting>
    </system.web.extensions>

You probably DON'T want to be sending around 10 000 lines via AJAX if you can avoid it (break it up into smaller requests or use paging).

like image 189
apandit Avatar answered Sep 20 '22 01:09

apandit


Similar question

JSON is similar to other data formats like XML - if you need to transmit more data, you just send more data. There's no inherent size limitation to the overall JSON request itself. Any limitation would be set by the server parsing the JSON request. (For instance, ASP.NET has the "MaxJsonLength" property of the serializer.)

like image 44
NebuSoft Avatar answered Sep 22 '22 01:09

NebuSoft