An error occurs because the URI defined in the query is longer than the URI length limit set on the webserver: Request-URI Too Large - When Running a Vault API Query.
To bypass this limitation, do the following:
- Use POST instead of GET.
- Place the query in the request body (still using the "q" parameter).
GET requests are made to request a particular resource from the server. Whatever information is required to fetch the desired resource are passed as query string parameters. The GET Method must not be used for passing very long strings, containing more than 2000 characters.
POST Requests are made to post some data to a particular resource for processing and also request a response.