PluginProbe
Auto Alt Text / trunk
Auto Alt Text vtrunk
3.0.3 2.8.2 1.3.1 1.3.2 2.0.0 2.1.0 2.1.1 2.2.0 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 2.4.0 2.4.1 2.4.2 2.5.0 2.5.1 2.5.2 2.5.3 2.6.0 2.6.1 2.7.0 2.8.0 2.8.1 All 28 releases
auto-alt-text / src / App / Infrastructure / Http / HttpClientInterface.php

HttpClientInterface.php in Auto Alt Text trunk, at src/App/Infrastructure/Http/HttpClientInterface.php

40 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace AATXT\App\Infrastructure\Http;
6
7 /**
8 * Interface for HTTP client implementations.
9 *
10 * Abstracts HTTP communication to allow dependency injection and testing.
11 * Concrete implementations should wrap WordPress HTTP functions or other HTTP libraries.
12 */
13 interface HttpClientInterface
14 {
15 /**
16 * Perform an HTTP POST request.
17 *
18 * @param string $url The URL to send the request to
19 * @param array<string, string> $headers HTTP headers as key-value pairs
20 * @param array<string, mixed> $body Request body data
21 *
22 * @return array<string, mixed> The response data
23 *
24 * @throws \Exception If the HTTP request fails
25 */
26 public function post(string $url, array $headers, array $body): array;
27
28 /**
29 * Perform an HTTP GET request.
30 *
31 * @param string $url The URL to send the request to
32 * @param array<string, string> $headers HTTP headers as key-value pairs
33 *
34 * @return array<string, mixed> The response data
35 *
36 * @throws \Exception If the HTTP request fails
37 */
38 public function get(string $url, array $headers = []): array;
39 }
40