I have a web application within which there is code to make a GET request. In the request, I am making call to a service passing userkeys as paaramter. A sample request URL is as below:
https://domainname/api/Method?userKey={1}&userKey={2}
The request returns proper response when the number of characters is around 2045 but errors out when the request length increases beyond that.
ERROR MESSAGE
When made the request from Postman client for Google Chrome
"404 file/directory not found (The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable)"
When called from backend code
The remote server returned an error: (404) Not Found. Exception: System.Net.WebException: The remote server returned an error: (404) Not Found.
If the issue is with length of the GET request, shouldn't I get an appropriate exception, like 'Request limit exceeded' or something? Instead I get the above error message.
But actually it looks like the request errors out when I send in more userkeys, thereby increasing the length of the GET request. The erroring request I make is something like this
https://domainname/api/Method?userKey={1}&userKey={2}&userKey={3}&userKey={4}&userKey={5}&userKey={6}.....&userKey={41}
The request errored out when I sent out more than 41 userkeys, when I only sent 40 userkeys, request length was below 2000 and it worked fine.
I have made a workaround to pass not more than 25 userkeys (parameter) per GET request so that the length stays well below 2000, but is there any other way I can increase the length of the request. How can I find out which is restricting the request length, the browser or the server?