Requests_Session::request()publicWP 1.0

Main interface for HTTP requests

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

{} It's a method of the class: Requests_Session{}

No Hooks.




$Requests_Session = new Requests_Session();
$Requests_Session->request( $url, $headers, $data, $type, $options );
$url(string) (required)
URL to request
Extra headers to send with the request
Default: array()
Data to send either as a query string for GET/HEAD requests, or in the body for POST requests
Default: array()
HTTP request type (use Requests constants)
Default: Requests::GET
Options for the request (see Requests::request())
Default: array()


Code of Requests_Session::request() WP 6.0

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

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