I have 2 rails applications, one in Rails 2 (client), and one in Rails 4 (API).
The issue is that sometimes I have GET queries with too long URI. API is raising ERROR WEBrick::HTTPStatus::RequestURITooLarge
exception.
At the moment, I have only 3 solutions that I do not like:
Transform GET query to POST/PUT (any query having body in request). I don't like it because the meaning of "get" have no sense anymore. I don't put anything, don't post anything, I only get information. http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html says:
The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. If the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the entity in the response and not the source text of the process, unless that text happens to be the output of the process.
Change the
MAX_URI_LENGTH
default value (as http://kandadaboggu.com/post/40618627239/fixing-webrick-httpstatus-requesturitoolarge does). For me, it's just crappy, and doesn't prevent to be big enough.Adding my params into
headers
like How do you add a custom http header? . For me, it's the less crappy solution. I don't know if it's standard, maintenable, and easily bring back for API.
Do you have any other solution ? If you haven't, whats the less crappy one ?