Requests for PHP
Description
Inspired by Requests for Python.
Based on concepts from SimplePie_File, RequestCore and WP_Http.
Methods
Name | Description |
---|---|
Requests::__construct | This is a static class, do not instantiate it |
Requests::add_transport | Register a transport |
Requests::autoloader | Deprecated autoloader for Requests. — deprecated |
Requests::compatible_gzinflate | Decompression of deflated string while staying compatible with the majority of servers. |
Requests::decode_chunked | Decoded a chunked body as per RFC 2616 |
Requests::decompress | Decompress an encoded body |
Requests::delete | Send a DELETE request |
Requests::flatten | Convert a key => value array to a ‘key: value’ array for headers |
Requests::flattern | Convert a key => value array to a ‘key: value’ array for headers — deprecated |
Requests::get | Send a GET request |
Requests::get_certificate_path | Get default certificate path. |
Requests::get_default_options | Get the default options |
Requests::get_transport | Get a working transport |
Requests::head | Send a HEAD request |
Requests::match_domain | – |
Requests::options | Send an OPTIONS request |
Requests::parse_multiple | Callback for `transport.internal.parse_response` |
Requests::parse_response | HTTP response parser |
Requests::patch | Send a PATCH request |
Requests::post | Send a POST request |
Requests::put | Send a PUT request |
Requests::register_autoloader | Register the built-in autoloader — deprecated |
Requests::request | Main interface for HTTP requests |
Requests::request_multiple | Send multiple HTTP requests simultaneously |
Requests::set_certificate_path | Set default certificate path. |
Requests::set_defaults | Set the default values |
Requests::trace | Send a TRACE request |
Source
class Requests extends WpOrg\Requests\Requests {
/**
* Deprecated autoloader for Requests.
*
* @deprecated 6.2.0 Use the `WpOrg\Requests\Autoload::load()` method instead.
*
* @codeCoverageIgnore
*
* @param string $class Class name to load
*/
public static function autoloader($class) {
if (class_exists('WpOrg\Requests\Autoload') === false) {
require_once __DIR__ . '/Requests/src/Autoload.php';
}
return WpOrg\Requests\Autoload::load($class);
}
/**
* Register the built-in autoloader
*
* @deprecated 6.2.0 Include the `WpOrg\Requests\Autoload` class and
* call `WpOrg\Requests\Autoload::register()` instead.
*
* @codeCoverageIgnore
*/
public static function register_autoloader() {
require_once __DIR__ . '/Requests/src/Autoload.php';
WpOrg\Requests\Autoload::register();
}
}
Changelog
Version | Description |
---|---|
6.2.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.