Piwik\API\Request::__construct PHP Method

__construct() public method

Constructor.
public __construct ( string | array $request = null, array $defaultRequest = null )
$request string | array Query string that defines the API call (must at least contain a **method** parameter), eg, `'method=UserLanguage.getLanguage&idSite=1&date=yesterday&period=week&format=xml'` If a request is not provided, then we use the values in the `$_GET` and `$_POST` superglobals.
$defaultRequest array Default query parameters. If a query parameter is absent in `$request`, it will be loaded from this. Defaults to `$_GET + $_POST`.
    public function __construct($request = null, $defaultRequest = null)
    {
        $this->request = self::getRequestArrayFromString($request, $defaultRequest);
        $this->sanitizeRequest();
        $this->renameModuleAndActionInRequest();
    }