Auth
5 months ago
Cookie
5 months ago
Exception
5 months ago
Proxy
5 months ago
Response
5 months ago
Transport
5 months ago
Utility
5 months ago
Auth.php
5 months ago
Autoload.php
5 months ago
Capability.php
5 months ago
Cookie.php
5 months ago
Exception.php
5 months ago
HookManager.php
5 months ago
Hooks.php
5 months ago
IdnaEncoder.php
5 months ago
Ipv6.php
5 months ago
Iri.php
5 months ago
Port.php
5 months ago
Proxy.php
5 months ago
Requests.php
5 months ago
Response.php
5 months ago
Session.php
5 months ago
Ssl.php
5 months ago
Transport.php
5 months ago
Transport.php
46 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Base HTTP transport |
| 4 | * |
| 5 | * @package Requests\Transport |
| 6 | */ |
| 7 | |
| 8 | namespace AmeliaVendor\WpOrg\Requests; |
| 9 | |
| 10 | /** |
| 11 | * Base HTTP transport |
| 12 | * |
| 13 | * @package Requests\Transport |
| 14 | */ |
| 15 | interface Transport { |
| 16 | /** |
| 17 | * Perform a request |
| 18 | * |
| 19 | * @param string $url URL to request |
| 20 | * @param array $headers Associative array of request headers |
| 21 | * @param string|array $data Data to send either as the POST body, or as parameters in the URL for a GET/HEAD |
| 22 | * @param array $options Request options, see {@see \WpOrg\Requests\Requests::response()} for documentation |
| 23 | * @return string Raw HTTP result |
| 24 | */ |
| 25 | public function request($url, $headers = [], $data = [], $options = []); |
| 26 | |
| 27 | /** |
| 28 | * Send multiple requests simultaneously |
| 29 | * |
| 30 | * @param array $requests Request data (array of 'url', 'headers', 'data', 'options') as per {@see \WpOrg\Requests\Transport::request()} |
| 31 | * @param array $options Global options, see {@see \WpOrg\Requests\Requests::response()} for documentation |
| 32 | * @return array Array of \WpOrg\Requests\Response objects (may contain \WpOrg\Requests\Exception or string responses as well) |
| 33 | */ |
| 34 | public function request_multiple($requests, $options); |
| 35 | |
| 36 | /** |
| 37 | * Self-test whether the transport can be used. |
| 38 | * |
| 39 | * The available capabilities to test for can be found in {@see \WpOrg\Requests\Capability}. |
| 40 | * |
| 41 | * @param array<string, bool> $capabilities Optional. Associative array of capabilities to test against, i.e. `['<capability>' => true]`. |
| 42 | * @return bool Whether the transport can be used. |
| 43 | */ |
| 44 | public static function test($capabilities = []); |
| 45 | } |
| 46 |