The Request class is used throughout Piwik to call API methods. The difference
between using Request and calling API methods directly is that Request
will do more after calling the API including: applying generic filters, applying queued filters,
and handling the **flat** and **label** query parameters.
Additionally, the Request class will **forward current query parameters** to the request
which is more convenient than calling {@link Piwik\Common::getRequestVar()} many times over.
In most cases, using a Request object to query the API is the correct approach.
### Post-processing
The return value of API methods undergo some extra processing before being returned by Request.
### Output Formats
The value returned by Request will be serialized to a certain format before being returned.
### Examples
**Basic Usage**
$request = new Request('method=UserLanguage.getLanguage&idSite=1&date=yesterday&period=week'
. '&format=xml&filter_limit=5&filter_offset=0')
$result = $request->process();
echo $result;
**Getting a unrendered DataTable**
use the convenience method 'processRequest'
$dataTable = Request::processRequest('UserLanguage.getLanguage', array(
'idSite' => 1,
'date' => 'yesterday',
'period' => 'week',
'filter_limit' => 5,
'filter_offset' => 0
'format' => 'original', // this is the important bit
));
echo "This DataTable has " . $dataTable->getRowsCount() . " rows.";