The Math MediaWiki extension makes use of the 3 endpoints exposed by mathoid service here: https://wikimedia.org/api/rest_v1/#/Math. Mathoid uses RESTBase for caching purposes.
1. /media/math/check/{type} - POST method 2. /media/math/formula/{hash} - GET method 2. /media/math/render/{format}/{hash} - GET method
We want to deprecate and remove the VirtualRESTService class. So, we will be using HTTP request objects in Math to access RESTBase and hence, Mathoid. In line with the RESTBase Sunsetting work currently going on and T333536, we'll be replacing usage of the VirtualRESTServiceClients with HTTP request objects for most if not all extensions that use it.
In the Math extension, specifically in MathRestbaseInterface.php class, we want to construct HTTP request objects for ::getContentRequest(), ::getCheckRequest() (for example) and use that to make the requests. Taking ::getContentRequest() for example, instead of returning an array with information about the request, we'll instead construct a MWHTTPRequest object and make a request like:
$request = MediaWikiServices::getInstance()->getHttpRequestFactory()->get( $this->getUrl( "media/math/render/$type/{$this->hash}" ) );
For all occurrences of where the ::getServiceClient() method is called, we need to survey callers and appropriately use an HTTP request object and make a request directly to RESTBase using the URL mentioned above.
Acceptance Criteria
- ::getCheckRequest() - replace this with parallel HTTP requests.
- ::getContentRequest() - replace this with parallel HTTP request.
- Retain the use of $wgVirtualRestConfig setting for backward compatibility
- Delete the ::getServiceClient() method and references to where it's called
- Ensure that the extension still works correctly for all endpoints exposed via Mathoid.