Summery Summery

Main interface for HTTP requests

Syntax Syntax

Requests_Session::request( string $url, array $headers = array(), array|null $data = array(), string $type = Requests::GET, array $options = array() )

Description Description

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

Parameters Parameters


(Required) URL to request


(Optional) Extra headers to send with the request

Default value: array()


(Optional) Data to send either as a query string for GET/HEAD requests, or in the body for POST requests

Default value: array()


(Optional) HTTP request type (use Requests constants)

Default value: Requests::GET


(Optional) Options for the request (see Requests::request)

Default value: array()

Return Return


Source Source

File: wp-includes/Requests/Session.php

	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']);


See also See also


Leave a Reply