1

I was trying to send a get request to django beackend which encodes a list of ids that I need. I noticed that when this list of id(string) goes too long, the django will not handle this request. I can see the request in the django test server, but it never actually enter any view. In the browser, nginx gives me 404.

URL: "/xxx/xxx/xxx?type=xxx&ids=4918230_25808605%2C4996758_49144848%2C5121093_43940616%2C56944804_40780188...."

I know I can maybe use post to encode params in the body instead, but I just want to find out the reason behind this.

YeeeeeS
  • 36
  • 1
  • 5
  • 1
    See https://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers – gogaz Dec 08 '17 at 00:35
  • What is the length of your URL? You shouldn't be passing 2000 from there on some devices start rejecting. For example it would be a bad idea trying to have base64 encoded string in your url. – user1767754 Dec 08 '17 at 00:41
  • hi, gogaz. I saw this answer but I am not sure if it's the same case. My first try was actually sending request from the JS. When I noticed the failure then I try to access it from the browser, and the maximum length I discovered here was around 3750. Does the browser also restrict the length with request within the JS code? – YeeeeeS Dec 08 '17 at 00:44
  • Some limitations can be imposed by your front server too... (whether hardcoded or configurable). – bruno desthuilliers Dec 08 '17 at 09:44

1 Answers1

0

The length of URL is often restricted by the Web Browser

Hayden
  • 449
  • 4
  • 13