Requests_Session::request() public WP 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.
Return
Requests_Response.
Usage
$Requests_Session = new Requests_Session(); $Requests_Session->request( $url, $headers, $data, $type, $options );
- $url(string) (required)
- URL to request
- $headers(array)
- Extra headers to send with the request
Default: array() - $data(array/null)
- Data to send either as a query string for GET/HEAD requests, or in the body for POST requests
Default: array() - $type(string)
- HTTP request type (use Requests constants)
Default: Requests::GET - $options(array)
- Options for the request (see Requests::request)
Default: array()
Notes
- See: Requests::request()
Code of Requests_Session::request() Requests Session::request WP 5.6
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']);
}