Maximum Number of Parameter Passed in a Post

Maximum number of parameter passed in a post

The number of parameters was limited in all web servers to plug the hashmap collision denial of service attack.

You can raise the limit by adding the following system property to the configuration file (e.g. standalone.xml):

<property name="org.apache.tomcat.util.http.Parameters.MAX_COUNT" value="10000"/>

(source)

Is there any limit on the number of parameters allowed in POST request to the server in Grails?

Yes.There is limit on the number of parameters as well as on the size of the content.

The good think is that these parameters are configurable.You need to change your default tomcat configuration.You can get more information about the default setting and other information here.

Also below references will help you understand and change the tomcat configuration.

max size for POST parameter content

maximum-allowable-size-in-tomcat

What is the maximum number of parameters for a method (WebApi ? )

You mean technically or practically? :p

The C# method parameter limit is 65,535. Most browsers only support an URL of 2000 to 4000 characters. Depending on the consumer of your API, there might be some restrictions there as well.

But most importantly: what are you trying to do? Seriously?

You're creating an API, simple methods that are easy to understand should be your main goal. I'm not sure a method with 65000 parameters would be anywhere near simple.

To me this sounds like step 1 of a walk down "OMG kill this code" lane :)

What is the maximum number of parameters that a C# method can be defined as taking?

Here is your theoretical answer:

In order to push method arguments onto the stack, compiled code has the following MSIL opcodes to choose from:

ldarg.0

ldarg.1

ldarg.2

ldarg.3

ldarg.S

ldarg

ldarg.0 to ldarg.3 is used to push the first 4 method arguments onto the stack (including this as the first argument for instance methods).

ldarg.S takes an 8-bit argument number, and so it can be used to push up to 256 arguments onto the stack.

That leaves us with plain old ldarg, which can handle the most method arguments: it takes an unsigned 16-bit argument number, so the largest number of arguments that can be successfully compiled into valid MSIL is 2^16 = 65,536.

As others have noted, however, the actual limit will depend on implementation details of the runtime. Based on rmiesen's answer, it looks like the current .NET implementation limits the maximum number of parameters to 2^14.

Maximum number of parameters in Java method declaration

That limit is defined in the JVM Specification:

The number of method parameters is limited to 255 by the definition of a method descriptor (§4.3.3), where the limit includes one unit for this in the case of instance or interface method invocations.

Section §4.3.3 gives some additional information:

A method descriptor is valid only if it represents method parameters with a total length of 255 or less, where that length includes the contribution for this in the case of instance or interface method invocations.

The total length is calculated by summing the contributions of the individual parameters, where a parameter of type long or double contributes two units to the length and a parameter of any other type contributes one unit.

Your observations were spot on, double word primitives (long/double) need twice the size of usual 4 bytes variables and 4 bytes object instance references.

Regarding the last part of your question related to 64bit systems, the specification defines how many units a parameter contribute, that part of the specification must still be complied with even on a 64bit platform, the 64bit JVM will accomodate 255 instance parameters (like your 255 Strings) regardless of the internal object's pointer size.

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.

Are there limitations to passing parameters through .post() in jquery

JQuery Ajax itself doesn't have any limits. The request size is limited on the server however trough various configurations which depend on your environment.

Apache:

  • LimitRequestBody, around 2Gb by default, maybe greater for 64bits, check error logs for details.

PHP:

  • post_max_size which is directly related to the POST size
  • upload_max_filesize which may be unrelated, not sure
  • max_input_time, if the POSt takes too long
  • max-input-nesting-level if your data is an array with a lot of sublevels
  • max_execution_time, but quite sure it's not that
  • memory_limit, as you may reach a size exceding the subprocess allowed memory
  • max_input_vars, if your data array has many elements

Taken from: https://stackoverflow.com/a/9691395/2853903



Related Topics



Leave a reply



Submit