Session::request()publicWP 1.0

Main interface for HTTP requests

This method initiates a request and sends it via a transport before parsing.

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

Хуков нет.




$Session = new Session();
$Session->request( $url, $headers, $data, $type, $options );
$url(строка) (обязательный)
URL to request
Extra headers to send with the request
По умолчанию: []
Data to send either as a query string for GET/HEAD requests, or in the body for POST requests
По умолчанию: []
HTTP request type (use \WpOrg\Requests\Requests constants)
По умолчанию: Requests::GET
Options for the request (see \WpOrg\Requests\Requests::request())
По умолчанию: []


  • Смотрите: \WpOrg\Requests[Requests::request()](/function/Requests::request)

Код Session::request() WP 6.3.1

public function request($url, $headers = [], $data = [], $type = Requests::GET, $options = []) {
	$request = $this->merge_request(compact('url', 'headers', 'data', 'options'));

	return Requests::request($request['url'], $request['headers'], $request['data'], $type, $request['options']);