aayush / hit-api
A simple PHP class for making HTTP requests using cURL.
Installs: 13
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/aayush/hit-api
Requires
- php: ^7.4|^8.0
- ext-curl: *
This package is auto-updated.
Last update: 2025-12-31 00:18:28 UTC
README
HitApi is a PHP helper class for making HTTP requests using cURL. It simplifies the process of sending GET, POST,
PUT, and DELETE requests with customizable headers and payloads.
Installation
To use HitApi, you need to have cURL enabled in your PHP environment. Simply include the HitApi.php file in your
project and follow the usage instructions below.
Usage
Basic Usage
-
Initialize: Start by initializing
HitApiwith the desired endpoint.use App\Helpers\HitApi; $response = HitApi::to('/endpoint') ->withHeader('Authorization', 'Bearer YOUR_TOKEN') ->withPayload(['key' => 'value']) ->get(); // Use get(), post(), put(), or delete() based on your needs
-
Initialize: Start by initializing
HitApiwith the desired endpoint.use App\Helpers\HitApi; $response = HitApi::to('/endpoint') ->withHeaders(['Authorization' => 'Bearer YOUR_TOKEN']) ->withPayload(['key' => 'value']) ->post(); // Use get(), post(), put(), or delete() based on your needs
How To Install
composer require aayush/hit-api