How do I resolve a HTTP 414 Request URI too long error?
Under Apache, the limit is a configurable value, LimitRequestLine
. Change this value to something larger than its default of 8190 if you want to support a longer request URI. The value is in /etc/apache2/apache2.conf. If not, add a new line (LimitRequestLine 10000
) under AccessFileName .htaccess
.
However, note that if you're actually running into this limit, you are probably abusing GET
to begin with. You should use POST
to transmit this sort of data -- especially since you even concede that you're using it to update values. If you check the link above, you'll notice that Apache even says "Under normal conditions, the value should not be changed from the default."
How to fix error 414 uri too long when calling api for upload image to server for mobilefirst 8
Try using FormParams instead of QueryParams, as QueryParams will be passed in the URL and it has some limitation to number of characters. Instead you can pass your json as FormParam,
var request = WLResourceRequest(url, method, options);
request.sendFormParameters(json).then(
function(response) {
// success flow
},
function(error) {
// fail flow
}
);
For further reference, visit below link and see methods for WLResourceRequest
.
http://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/api/client-side-api/javascript/client/
HTTP Error 414. The request URL is too long
According to this question the maximum practical length of a URL is 2000 characters. This isn't going to be able to hold a massive Wikipedia article like you're trying to send.
Instead of putting the data on the URL you should be putting it in the body of a POST request. You need to add a data
value to the object you're passing to the ajax function call. Like this:
function editAbout(){
var about=escape( $("#editorAbout").text());
$.ajax({
url: "Allcammand.aspx?cmd=EditAboutCompany&idCompany="+getParam("idCompany"),
type:"post",
async: false,
data: {
about: about
},
success: function(response){
},
error:function(xhr, ajaxOptions, thrownError){alert(xhr.responseText); ShowMessage("??? ?? ?????? ??????? ????","fail");}
});
}
NET Core API : 414 request-uri too long
The term you need to search for is maxUrlLength.
See this as a possible answer -> ASP.Net Core maxUrlLength
The answer is really server-specific, IIS, Kestrel, etc.. you also gotta factor that browsers also have limits.
Your best bet is to switch to a POST.
Dropwizard: How to fix 414 Request-URI Too Long
You have a Request URI that is over 8kb in size! Eeesh!
Request-URI limits exist because of various vulnerabilities and bugs found in browsers, proxies, and networking hardware.
While it is possible to increase the Request URI limit checks in Jetty, the values chosen for Jetty represent the current safe maximums in use by various http clients and intermediaries on the public internet.
WARNING: YOU DO NOT WANT TO DO THIS
This is inappropriate for:
- A WebServer accessible from the Internet.
- A WebServer accessed by browsers like Chrome, Firefox, Safari, MSIE, or Opera.
- A WebServer accessed by a mobile device like Android, iOS, or Microsoft mobile.
- A WebServer that has a proxy in front of it.
- A client that uses a proxy to access the WebServer.
This is only useful for transactions limited between custom HTTP clients directly talking to a Jetty server.
Instructions for Jetty 9.2.6.v20141205
If you don't have a Jetty Base ${jetty.base}
directory yet, create one, and initialize it.
[user]$ mkdir mybase
[user]$ cd mybase
[mybase]$ java -jar /path/to/jetty-distribution-9.2.6.v20141205/start.jar \
--add-to-start=http,deploy,webapp
Edit the ${jetty.base}/start.ini
And change (or add) the following property with your desired upper limit.
jetty.request.header.size=8192
And no, there is no way to disable this limit check.
For each increase you open yourself up to greater and greater issues.
Starting with some browsers (and eventually all browsers) not being send the request, let alone jetty receiving it.
Meanwhile the ability of many proxy servers to handle your request starts to fail, resulting in terminated and failed connections or requests. Sometimes even truncated requests to Jetty.
Also each increase exposes you to various vulnerabilities surrounding unchecked limits in headers, resulting in the ability of various groups in executing CPU and Memory based DOS attacks that require very little network traffic to perform.
The Correct Way to Fix This:
You really should switch to POST (or PUT) based request data, and not be sending that amount of data in the request headers of the HTTP protocol.
Related Topics
How to Get Data from Another Table Using Id from Another Table
How to Count Columns With the Same Value in a Specific Row in MySQL
Regex Optionally Match a Pattern Multiple Times
How to Get Part of Url Before Last Slash With PHP
How to Update Stock Quantity Using MySQL in PHP
Setting Selected Option in Laravel Form
How to Sanitize User Input With PHP
Pdo Support For Multiple Queries (Pdo_MySQL, Pdo_MySQLnd)
Getting Error in Console:Failed to Load Resource: Net::Err_Connection_Reset
Laravel: Products,Categories and Subcategories! (Relation Ships)
How to Remove Query Part from $Request->All() in Laravel Framework
How to Delete Completed Orders in Woocommerce Using a My SQL Query