1

What is the right way to make a very long get request?

For example, to get a table or report of a lot of stuff from a big database, the client has a filter and can choose from a long list of over 300 choices (multi-select). If he chooses to select all, or almost all of them, the created URL params sent to the server will be so many that it makes the URL too big.

I have thought of some ways to reduce redundancy that will make the URL smaller. But in case this doesn't work, and for future knowledge, what is the right way to make long get requests? Do they have to be "split up", and if so, does the server have to first store the 1st half and then read it during the 2nd get request?

pete
  • 1,878
  • 2
  • 23
  • 43
  • Please provide some code or at the very least a sample URL that you're building. – Corey Ogburn Dec 27 '13 at 23:36
  • 2
    This is generally achived by sending a POST request to server instead of a classic GET with params provided within the URL. Do not pass params on the url but in the post data. Chose a content type adapted to what you want to send. – Stephane Lallemagne Dec 28 '13 at 14:18
  • Are you sure the URI is too big? There is no conceptual limit to the size of a URI, only implementation constraints of intermediary components. – Darrel Miller Dec 28 '13 at 16:13
  • 2
    Use post, don't use get. Servers apply limitations to the length of the URI – Mike_Jr Nov 06 '18 at 12:50

0 Answers0