komtcho / shot
Build classes for HTTP request
Installs: 1 005
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
This package is not auto-updated.
Last update: 2025-01-02 03:39:59 UTC
README
Calling HTTP requests by class encapsulating
Example:-
<?php use Komtcho\Shot\Contracts\ShootingGet; use Komtcho\Shot\Contracts\WithHeaders; use Komtcho\Shot\Shooting; class Request extends Shooting implements WithHeaders, ShootingGet { protected $url = 'https://webhook.site/9148264c-19c9-4c35-b0f9-0d71cdec3c9d'; public function headers(): array { return [ 'X-First' => 'foo', 'X-Second' => 'bar', ]; } public function query(): array { return []; } } // Calling $request = new Request; return $request->call();