Yoast\WP\SEO\Config

OAuth_Client::do_request()protectedYoast 1.0

Performs the specified request.

Метод класса: OAuth_Client{}

Хуков нет.

Возвращает

Разное. The parsed API response.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->do_request( $method, $url, $options );
$method(строка) (обязательный)
The HTTP method to use.
$url(строка) (обязательный)
The URL to send the request to.
$options(массив) (обязательный)
The options to pass along to the request.

Код OAuth_Client::do_request() Yoast 22.3

protected function do_request( $method, $url, array $options ) {
	$defaults = [
		'headers' => $this->provider->getHeaders( $this->get_tokens()->access_token ),
	];

	$options = \array_merge_recursive( $defaults, $options );

	if ( \array_key_exists( 'params', $options ) ) {
		$url .= '?' . \http_build_query( $options['params'] );
		unset( $options['params'] );
	}

	$request = $this->provider
		->getAuthenticatedRequest( $method, $url, null, $options );

	return $this->provider->getParsedResponse( $request );
}