yii\authclient\OpenId::sendRequest PHP Method

sendRequest() protected method

Sends request to the server
protected sendRequest ( string $url, string $method = 'GET', array $params = [] ) : array | string
$url string request URL.
$method string request method.
$params array request parameters.
return array | string response.
    protected function sendRequest($url, $method = 'GET', $params = [])
    {
        $request = $this->createRequest()->setMethod($method)->setUrl($url)->setData($params);
        if ($this->verifyPeer !== null) {
            $options = ['sslVerifyPeer' => $this->verifyPeer];
            if ($this->capath) {
                $options['sslCapath'] = $this->capath;
            }
            if ($this->cainfo) {
                $options['sslCafile'] = $this->cainfo;
            }
            $request->addOptions($options);
        }
        $response = $request->send();
        if ($method == 'HEAD') {
            $headers = [];
            foreach ($response->getHeaders()->toArray() as $name => $values) {
                $headers[strtolower($name)] = array_pop($values);
            }
            return $headers;
        }
        return $response->getContent();
    }