Upon making an Ajax Post, the error I encountered is as follows: 414 Request-URI Too Large
I am confused as to why the data is being sent over the URL and not just in the body. In Chrome, I can see the param1 data in the request URL, query string parameters, and in the request payload. How do I remove it from the URL?
routes = JSON.stringify(routes);
$.ajax({
type: "POST",
url: "http://127.0.0.1:3000/s",
data: {
param1: routes
},
success: function(data) {
$('div.home-products').html(
data);
}
});
This is the entire routes object after stringify:
{big JSON object with various details}
Shown below are details from the Chrome network:
Request URL: URL that exceeds character limit due to large amount of data Request Method: POST Status Code: 414 Request-URI Too Large Remote Address: 127.0.0.1:3000 Referrer Policy: no-referrer-when-downgrade Response Headers... Request Headers... Query String Parameters... Form Data...