Command.php
1 month ago
DB.php
1 month ago
Date.php
1 week ago
Event.php
1 week ago
File.php
1 month ago
Guard.php
1 month ago
Http.php
1 month ago
Log.php
1 month ago
Option.php
1 month ago
Schema.php
1 month ago
Http.php
66 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Facade proxy for the HTTP client Request builder. |
| 5 | * Exposes get, post, with_token, as_json, and other fluent request methods. |
| 6 | * Entry point for outbound HTTP integrations. |
| 7 | * |
| 8 | * @package Framework |
| 9 | * @subpackage Supports\Facades |
| 10 | * @since 1.0.0 |
| 11 | */ |
| 12 | namespace Kirki\Framework\Supports\Facades; |
| 13 | |
| 14 | \defined('ABSPATH') || exit; |
| 15 | use Kirki\Framework\Facade; |
| 16 | // phpcs:disable Generic.Files.LineLength.TooLong |
| 17 | /** |
| 18 | * Facade proxy for the HTTP client Request builder. |
| 19 | * |
| 20 | * @method static \Framework\Http\Client\Response get(string $url, array $options = []) |
| 21 | * @method static \Framework\Http\Client\Response post(string $url, array $options = []) |
| 22 | * @method static \Framework\Http\Client\Response put(string $url, array $options = []) |
| 23 | * @method static \Framework\Http\Client\Response patch(string $url, array $options = []) |
| 24 | * @method static \Framework\Http\Client\Response delete(string $url, array $options = []) |
| 25 | * @method static \Framework\Http\Client\Response head(string $url, array $options = []) |
| 26 | * @method static \Framework\Http\Client\Response options(string $url, array $options = []) |
| 27 | * @method static \Framework\Http\Client\Request with_headers(array $headers) |
| 28 | * @method static \Framework\Http\Client\Request with_url_parameters(array $parameters) |
| 29 | * @method static \Framework\Http\Client\Request with_body($content, $type = 'application/json') |
| 30 | * @method static \Framework\Http\Client\Request with_token(string $token, $type = 'Bearer') |
| 31 | * @method static \Framework\Http\Client\Request with_user_agent($user_agent) |
| 32 | * @method static \Framework\Http\Client\Request without_verifying() |
| 33 | * @method static \Framework\Http\Client\Request accept($value) |
| 34 | * @method static \Framework\Http\Client\Request accept_json() |
| 35 | * @method static \Framework\Http\Client\Request body_format(string $format) |
| 36 | * @method static \Framework\Http\Client\Request as_json() |
| 37 | * @method static \Framework\Http\Client\Request as_form() |
| 38 | * @method static \Framework\Http\Client\Request as_multipart() |
| 39 | * @method static \Framework\Http\Client\Request method(string $method) |
| 40 | * @method static \Framework\Http\Client\Request attach(string $name, string $content, ?string $filename = null, array $headers = []) |
| 41 | * @method static \Framework\Http\Client\Request macro($name, callable $macro) |
| 42 | * @see \Framework\Http\Client\Request |
| 43 | */ |
| 44 | class Http extends Facade |
| 45 | { |
| 46 | /** |
| 47 | * The is cacheable. |
| 48 | * |
| 49 | * @var bool |
| 50 | * |
| 51 | * @since 1.0.0 |
| 52 | */ |
| 53 | protected static $is_cacheable = \false; |
| 54 | /** |
| 55 | * Get the accessor. |
| 56 | * |
| 57 | * @return mixed |
| 58 | * |
| 59 | * @since 1.0.0 |
| 60 | */ |
| 61 | public static function get_accessor() |
| 62 | { |
| 63 | return 'client-request'; |
| 64 | } |
| 65 | } |
| 66 |