0

Getting error on SOLR for GET request Request is larger than 20 MB or headers are too large. Please reduce the size of your request and try again, or contact [email protected] with a sample of your request for further assistance.

Sample request below: removing curl request due to security reason Response:

HTTP/2 413
date: Thu, 06 May 2021 16:25:31 GMT
content-type: application/json
content-length: 218

{"code":413,"message":"Request is larger than 20 MB or headers are too large. Please reduce the size of your request and try again, or contact [email protected] with a sample of your request for further assistance."}

I am not sure how the request become more than 20MB. Also send nothing on header.

rahul mishra
  • 1,390
  • 9
  • 16
  • [This answer](https://stackoverflow.com/a/812962/1270789) says Apache has `a server URL length limit of approximately 4,000 characters, after which Apache produces a "413 Entity Too Large" error` Your query string is over 8,000 characters, so that could be causing the error? – Ken Y-N May 06 '21 at 16:41
  • It is possible to use an HTTP POST (instead of GET) when querying Solr. This would allow you to bypass the 4K limit. – Hector Correa May 06 '21 at 17:12

1 Answers1

0

Websolr support here. When you pass those query parameters in the curl command, they are part of the Request-Line header. There are over 5900 characters in that line, which is what's triggering the HTTP 413.

As a workaround, just use a POST:

curl -i "removing data due to security reason"
rahul mishra
  • 1,390
  • 9
  • 16
Rob Sears
  • 366
  • 1
  • 5