Long URL causing 400 bad request
Long URL causing 400 bad request
Hi,
I am using datatables in my project and it is simply amazing. Kudos!
I have faced an issue which I haven't found satisfactorily answered anywhere in my quick search.
I am using server side option to filter and search the data.
This is my query, which works in Firefox and does not work in Chrome and I have got my answers to why it doesn't.
It is long query and every browser has its limit of processing GET queries. This query is crossing about 4000 characters and server first responds with 401 for authorization and later browser simply returns 400, i believe because adding authorization header to already long query is out of the range of Chrome & IE.
My Question is: there are only 4 or 5 columns that I sort/ filter and search on. Is there a way in DT where I could simply not pass every column parameter in query.
Or is there any other way to deal with this issue?
I can't use POST method because I am using existing backend APIs which I am not allowed to change.
I will also post this query on SO to get some answers.
Any help is appreciated, thanks in advance.
This question has an accepted answers - jump to answer
Answers
You can use
ajax.data
to modify the data submitted to the server. For example you could loop overcolumns
and remove theorderable
option which would save some space.Allan
Is there anything that DT can't do. :-)
Thanks. I will give it a try..
I sure do wish it would make toast and coffee in the morning... ;-)
Allan