Yoast\WP\SEO\AI_HTTP_Request\Infrastructure

API_Client_Interface{}interfaceYoast 1.0

Interface for the API client.

Хуков нет.

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

$API_Client_Interface = new API_Client_Interface();
// use class methods

Методы

  1. public get_request_timeout()
  2. public perform_request( string $action_path, $body, $headers, string $http_method )
  3. ERROR: no method name found on line ``
  4. ERROR: no method name found on line ``
  5. ERROR: no method name found on line ``
  6. ERROR: no method name found on line `/**`

Код API_Client_Interface{} Yoast 28.3

interface API_Client_Interface {

	/**
	 * Performs a request to the API.
	 *
	 * @param string             $action_path The action path for the request.
	 * @param array<string>|null $body        The body of the request, or null/empty to send no body.
	 * @param array<string>      $headers     The headers for the request.
	 * @param string             $http_method The HTTP method for the request. One of `Request::METHOD_*`.
	 *
	 * @return array<int|string|array<string>> The response from the API.
	 *
	 * @throws WP_Request_Exception When the underlying WordPress HTTP call returns an error.
	 */
	public function perform_request( string $action_path, $body, $headers, string $http_method ): array;

	/**
	 * Gets the timeout of the requests in seconds.
	 *
	 * @return int The timeout of the suggestion requests in seconds.
	 */
	public function get_request_timeout(): int;
}