Problem: POST is intended for requests that modify state, which queries should not do. Using POST for queries hides the query parameters from logs and metrics, making it harder to investigate incidents and identify usage patterns. It also makes it impossible to implement rules for specific queries (e.g. meta=tokens) in layers that sit in front of MediaWiki (e.g. for rate limiting in the API/REST gateway). Finally, POST requests have to be handled by the primary data center, preventing effective load balancing.
Proposal: The API documentation should include a recommendation to not use POST requests for queries, and if POST must be used, to include as many of the parameters as possible in the URL (compare T421288). Eventually, we should log a warning when receiving query requests as POST, and finally we should refuse such requests (possibly with some exceptions).
Exceptions:
Certain query modules require the request to be posted (codesearch). These would obviously have to be exempt from this rule. However, these modules should be examined to determine whether that requirement is actually needed, or accidental.
Sometimes it is necessary to list a large number of titles or IDs for processing in a query, which would exceed the maximum length of the URL if encoded in as query parameters. Using POST request for these cases could be allowed for users that have the apihighlimits right, since that indicates that the account is allowed to make expensive API queries.