Got this error on a big $_GET
query in size ~9 000 symbols (they are divided into ~10 variables).
Request-URI Too Large
The requested URL's length exceeds the capacity limit for this server.
What is a workaround for this problem?
In the case of the 414 Request-URI Too Large error, the problem is clear: the URLs being passed to the server are too big. To fix it, you'll need to change your Apache or Nginx server settings. This doesn't take too long, and once you're done, you should be back up and running.
The HTTP 414 URI Too Long response status code indicates that the URI requested by the client is longer than the server is willing to interpret.
5.1. The Request-URI is a Uniform Resource Identifier (section 3.2) and identifies the resource upon which to apply the request. Request-URI = "*" | absoluteURI | abs_path | authority. The four options for Request-URI are dependent on the nature of the request.
There is no workaround if you want pass all these info with GET without change server configuration.
Other solutions:
This worked for me (it needs formData support):
<script>
//Load form
var formData = new FormData();
formData.append("param_name1", "param_content1");
formData.append("param_name2", "param_content2");
formData.append("param_nameN", "param_contentN");
//Send form via AJAX
var xhr = new XMLHttpRequest();
xhr.open("POST", YOUR_URL);
xhr.send(formData);
</script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With