Netflex HTTP library

v4.29.1 2023-03-24 14:54 UTC


Stable version Build status License: MIT Contributors Downloads

[READ ONLY] Subtree split of the Netflex Http component (see netflex/framework)

This library provides a standalone Http client.


composer require netflex/http



use Netflex\Http\Client;

$client = new Client();

$post = $client->get('');

echo $post->title;

The default for the client is to automatically parse the content based on it's content type.

If the content type is application/json, it will be parsed as an object. If you need the response as a associative array instead, all the http methods on the client takes an optional last boolean argument that enables this.

$post = $client->get('', true);

echo $post['title'];

Laravel service provider and facade

If installed through Laravel, you can use the Facade. The service provider will auto register.


use Netflex\Http\Facades\Http;

$post = Http::get('');

echo $post->title;

You can optionally use the alias:


use Http;

$post = Http::get('');

echo $post->title;