manticoresearch
manticoresearch copied to clipboard
Support different request formats to the '/sql' endpoint
To provide compatibility with our auto-generated OpenAPI clients, we should support an alternative format for the /sql POST request.
The format we currently require is:
POST /sql -d "query={URL_ENCODED_QUERY}"
The alternative format would be:
POST /sql -d "{NOT_URL_ENCODED_QUERY}"
Daemon should check if the request body starts with the query= prefix to detect if it's URL-encoded or not.
Also, since the meaning of the mode=raw query string parameter can be not clear enough for the users of our clients, we should introduce an alias raw_response=true for it. I.e, the following request:
POST /sql?raw_response=true -d "query={QUERY}"
should be handled as equal to:
POST /sql?mode=raw -d "query={QUERY}"
The documentation should be updated (and proofread) accordingly.
This issue blocks https://github.com/manticoresoftware/openapi/issues/16
@Nick-S-2018 pls review https://github.com/manticoresoftware/manticoresearch/pull/2158
Done