What Is the Size Limit of a Post Request

Can HTTP POST be limitless?

EDIT (2019) This answer is now pretty redundant but there is another answer with more relevant information.

It rather depends on the web server and web browser:

Internet explorer All versions 2GB-1

Mozilla Firefox All versions 2GB-1

IIS 1-5 2GB-1

IIS 6 4GB-1

Although IIS only support 200KB by default, the metabase needs amending to increase this.

http://www.motobit.com/help/scptutl/pa98.htm

The POST method itself does not have any limit on the size of data.

What is the size limit of a post request?

It depends on a server configuration. If you're working with PHP under Linux or similar, you can control it using .htaccess configuration file, like so:

#set max post size
php_value post_max_size 20M

And, yes, I can personally attest to the fact that this works :)

If you're using IIS, I don't have any idea how you'd set this particular value.

In a post method, what is the limit size of a json in the request body?

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.)

Maximum length of HTTP GET request

The limit is dependent on both the server and the client used (and if applicable, also the proxy the server or the client is using).

Most web servers have a limit of 8192 bytes (8 KB), which is usually configurable somewhere in the server configuration. As to the client side matter, the HTTP 1.1 specification even warns about this. Here's an extract of chapter 3.2.1:

Note: Servers ought to be cautious about depending on URI lengths above 255 bytes, because some older client or proxy implementations might not properly support these lengths.

The limit in Internet Explorer and Safari is about 2 KB, in Opera about 4 KB and in Firefox about 8 KB. We may thus assume that 8 KB is the maximum possible length and that 2 KB is a more affordable length to rely on at the server side and that 255 bytes is the safest length to assume that the entire URL will come in.

If the limit is exceeded in either the browser or the server, most will just truncate the characters outside the limit without any warning. Some servers however may send an HTTP 414 error.

If you need to send large data, then better use POST instead of GET. Its limit is much higher, but more dependent on the server used than the client. Usually up to around 2 GB is allowed by the average web server.

This is also configurable somewhere in the server settings. The average server will display a server-specific error/exception when the POST limit is exceeded, usually as an HTTP 500 error.

Domino Access Services POST limited to specific size

According to your example, you are sending the following JSON payload:

{
"description": "any large string"
}

That writes a Text field -- not a Rich Text field. There is definitely a limit to the size of a Text field in Notes and Domino.

Technically, you cannot write a Notes Rich Text field with the data API, but you can write a MIME field. Try sending the following JSON payload instead:

{
"description": {
"type": "multipart",
"content": [
{
"contentType": "text/plain",
"data": "any large string"
}
]
}

That writes a single text/plain part wrapped in a multipart MIME field. It should work no matter the length of the data property. Just keep in mind the MIME field is not traditional Notes Rich Text. In most cases, it is interchangeable with Rich Text, but that depends on what you are doing with the data.

Caveat: I haven't tried sending the exact payload in my example, but I'm 99% sure it should work. For more information on the multipart data type see Receiving a response body.



Related Topics



Leave a reply



Submit