Xpressengine\Plugin\PluginProvider::request PHP Method

request() protected method

send request to server.
protected request ( string $url, array $queries = [] ) : mixed
$url string request url
$queries array list of query string
return mixed
    protected function request($url, $queries = [])
    {
        $url = $this->url . '/' . trim($url, '/');
        $client = new Client();
        $options = ['headers' => ['Accept' => 'application/json'], 'query' => $queries];
        if ($this->auth !== null) {
            $options['auth'] = $this->auth;
        }
        $res = $client->request('GET', $url, $options);
        return json_decode($res->getBody());
    }