Http requests made simple

1.1.0 2018-07-06 19:53 UTC

This package is auto-updated.

Last update: 2024-05-07 20:03:12 UTC


README

pipeline status Latest Stable Version coverage report Total Downloads License

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;