Warning! You are currently reading the documentation for Requests 1.x.
It is recommended to upgrade to Requests 2.x at your earliest convenience.
Upgrading to Requests 2.x is fairly straight-forward.
A full list of the changes can be found in the Changelog.
Visit the documentation for Requests_Session
in Requests 2.x.
Class Requests_Session
Session handler for persistent requests and default parameters
Allows various options to be set as default values, and merges both the options and URL properties together. A base URL can be set for all requests, with all subrequests resolved from this. Base options can be set (including a shared cookie jar), then overridden for individual requests.
public
|
#
__construct( string|null $url = null, array $headers = array(), array $data = array(), array $options = array() )
Create a new session |
public
mixed|null
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
#
request( string $url, array $headers = array(), array|null $data = array(), string $type =
Main interface for HTTP requests |
public
array
|
#
request_multiple( array $requests, array $options = array() )
Send multiple HTTP requests simultaneously |
protected
array
|
#
merge_request( array $request, boolean $merge_options = true )
Merge a request's data with the default data |
public
string|null
|
$url
Base URL for requests |
#
null
|
public
array
|
$headers
Base headers for requests |
#
array()
|
public
array
|
$data
Base data for requests |
#
array()
|
public
array
|
$options
Base options for requests |
#
array()
|