[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/Requests/ -> Session.php (summary)

Session handler for persistent requests and default parameters

File Size: 268 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Requests_Session:: (14 methods):
  __construct()
  __get()
  __set()
  __isset()
  __unset()
  get()
  head()
  delete()
  post()
  put()
  patch()
  request()
  request_multiple()
  merge_request()


Class: Requests_Session  - X-Ref

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.

__construct($url = null, $headers = array()   X-Ref
Create a new session

param: string|null $url Base URL for requests
param: array $headers Default headers for requests
param: array $data Default data for requests
param: array $options Default options for requests

__get($key)   X-Ref
Get a property's value

return: mixed|null Property value, null if none found
param: string $key Property key

__set($key, $value)   X-Ref
Set a property's value

param: string $key Property key
param: mixed $value Property value

__isset($key)   X-Ref
Remove a property's value

param: string $key Property key

__unset($key)   X-Ref
Remove a property's value

param: string $key Property key

get($url, $headers = array()   X-Ref
Send a GET request


head($url, $headers = array()   X-Ref
Send a HEAD request


delete($url, $headers = array()   X-Ref
Send a DELETE request


post($url, $headers = array()   X-Ref
Send a POST request


put($url, $headers = array()   X-Ref
Send a PUT request


patch($url, $headers, $data = array()   X-Ref
Send a PATCH request

Note: Unlike {@see post} and {@see put}, `$headers` is required, as the
specification recommends that should send an ETag


request($url, $headers = array()   X-Ref
Main interface for HTTP requests

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

return: Requests_Response
param: string $url URL to request
param: array $headers Extra headers to send with the request
param: array|null $data Data to send either as a query string for GET/HEAD requests, or in the body for POST requests
param: string $type HTTP request type (use Requests constants)
param: array $options Options for the request (see {@see Requests::request})

request_multiple($requests, $options = array()   X-Ref
Send multiple HTTP requests simultaneously

return: array Responses (either Requests_Response or a Requests_Exception object)
param: array $requests Requests data (see {@see Requests::request_multiple})
param: array $options Global and default options (see {@see Requests::request})

merge_request($request, $merge_options = true)   X-Ref
Merge a request's data with the default data

return: array Request data
param: array $request Request data (same form as {@see request_multiple})
param: boolean $merge_options Should we merge options as well?



Generated: Thu Dec 15 01:00:02 2022 Cross-referenced by PHPXref 0.7.1