WPDev.one
Core Class

Requests

class Requests // Constructor: function Object() { [native code] }

Requests for PHP

Methods 25 methods

Method / Return Description
__construct()
void

This is a static class, do not instantiate it

add_transport()
void

Register a transport

Parameters: $transport: mixed
get_transport_class()
string

Get the fully qualified class name (FQCN) for a working transport.

Parameters: $capabilities: array
get_transport()
\WpOrg\Requests\Transport

Get a working transport.

Parameters: $capabilities: array
has_capabilities()
bool

Checks to see if we have a transport for the capabilities requested.

Parameters: $capabilities: array
get()
void

Send a GET request

Parameters: $url: mixed, $headers: mixed, $options: mixed
head()
void

Send a HEAD request

Parameters: $url: mixed, $headers: mixed, $options: mixed
delete()
void

Send a DELETE request

Parameters: $url: mixed, $headers: mixed, $options: mixed
trace()
void

Send a TRACE request

Parameters: $url: mixed, $headers: mixed, $options: mixed
post()
void

Send a POST request

Parameters: $url: mixed, $headers: mixed, $data: mixed, $options: mixed
put()
void

Send a PUT request

Parameters: $url: mixed, $headers: mixed, $data: mixed, $options: mixed
options()
void

Send an OPTIONS request

Parameters: $url: mixed, $headers: mixed, $data: mixed, $options: mixed
patch()
void

Send a PATCH request

Parameters: $url: mixed, $headers: mixed, $data: mixed, $options: mixed
request()
\WpOrg\Requests\Response

Main interface for HTTP requests

Parameters: $url: mixed, $headers: mixed, $data: mixed, $type: mixed, $options: mixed
request_multiple()
array

Send multiple HTTP requests simultaneously

Parameters: $requests: mixed, $options: mixed
get_default_options()
array

Get the default options

Parameters: $multirequest: mixed
get_certificate_path()
string

Get default certificate path.

set_certificate_path()
void

Set default certificate path.

Parameters: $path: mixed
set_defaults()
void

Set the default values

Parameters: $url: mixed, $headers: mixed, $data: mixed, $type: mixed, $options: mixed
parse_response()
\WpOrg\Requests\Response

HTTP response parser

Parameters: $headers: mixed, $url: mixed, $req_headers: mixed, $req_data: mixed, $options: mixed
parse_multiple()
void

Callback for `transport.internal.parse_response`

Parameters: $response: mixed, $request: mixed
decode_chunked()
string

Decoded a chunked body as per RFC 2616

Parameters: $data: mixed
flatten()
array

Convert a key => value array to a 'key: value' array for headers

Parameters: $dictionary: mixed
decompress()
string

Decompress an encoded body

Parameters: $data: mixed
compatible_gzinflate()
(string

Decompression of deflated string while staying compatible with the majority of servers.

Parameters: $gz_data: mixed

Properties

Property / Type Description
$transport
mixed
public
No description available.
$transports
mixed
public
No description available.
$certificate_path
mixed
public
No description available.
$magic_compression_headers
mixed
public
No description available.

Class Information

Source File
wp-includes/Requests/src/Requests.php
Advertisement