sparq-php / http
Http requests made simple
1.1.0
2018-07-06 19:53 UTC
Requires
- php: >=5.4
- sparq-php/event: 1.*
Requires (Dev)
- phpunit/phpunit: ^5
This package is auto-updated.
Last update: 2025-03-07 22:03:15 UTC
README
A simple to use http request microframework.
Installation and Autoloading
The recommended method of installing is via Composer.
Run the following command from your project root:
$ composer require sparq-php/http
Objectives
- Simple to use http requests
- Easy integration with other packages/frameworks
- Fast and low footprint
Usage
require_once __DIR__ . "/vendor/autoload.php";
use Sparq\Http\RequestBuilder;
$base_url = 'https://targetdomain.com';
$headers = [
'Content-Type' => 'application/json'
];
$options = []; // Adapter Options
$RequestBuilder = new RequestBuilder($base_url, $headers, $options);
$Result = $RequestBuilder->run('/resourse', 'GET');
$body = $Result->request->body;