What to do when you have large number of query in one url
What to do when you have large number of query in one url
nilayy1234
Posts: 1Questions: 1Answers: 0
Hey I am getting this "Failed to load resource: the server responded with a status of 414 (Request-URI Too Large)" Is there any way how to fix this
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Did you ever figure this out? I think there is a way to modify the request and I'm also looking for documentation.
I'm going to guess you are making a server-side processing request. If so, I would suggest you use POST rather than GET. See this example.
Allan
@allan yes this helped although, I get 400 bad request from jquery 2.1.4. I will try to make an example and post.
My 404 issue was that I needed to change my route server-side from router.get to router.post (node.js) app.
@allan before changing to POST, I referenced the filters like so:
req.query.columns[3]
Now with POST, data looks like this in the logs:
draw=1, columns[0][data]=0, columns[0][name]=, columns[0][searchable]=true etc..
I tried using dataType json but I can't seem to reference the columns.
Figured it out:
from the client side:
ajax: {
"url": "/historyData",
"type": "POST",
data: function ( d ) {
return { 'd': JSON.stringify( d ) };
}
}
from the server side (node.js on express):
var mybody = JSON.parse(req.body.d);
mybody.columns[3].search.value
Found one of @allan 's comments from another post:
https://github.com/DataTables/DataTables/issues/311