Laravel package to integrate the Httplug generic HTTP client into Laravel
php-http/laravel-httplug is a Laravel package for laravel package to integrate the httplug generic http client into laravel.
It currently has 12 GitHub stars and 110.086 downloads on Packagist (latest version 0.1.0).
Install it with composer require php-http/laravel-httplug.
Discover more Laravel packages by php-http
or browse all Laravel packages to compare alternatives.
Last updated
Via Composer
$ composer require php-http/laravel-httplug
With Laravel 5.5 or newer, the package will be discovered automatically.
If you're using an older version of Laravel, add the following to your
config/app.php:
<?php
// config.app
'providers' => [
...,
...,
Http\Httplug\HttplugServiceProvider::class,
],
'aliases' => [
...,
...,
'Httplug' => Http\Httplug\Facade\Httplug::class,
],
Publish the package config file to config/httplug.php:
php artisan vendor:publish --provider="Http\Httplug\HttplugServiceProvider"
<?php
// Create a request using a MessageFactory
$factory = app()->make('httplug.message_factory.default');
$request = $factory->createRequest('GET', 'http://httpbin.org');
$httplug = app()->make('httplug');
// Send request with default driver
$response = $httplug->sendRequest($request);
// Send request with another driver
$response = $httplug->driver('curl')->sendRequest($request);
// Send request with default driver using facade
$response = Httplug::sendRequest($request);
// Send request with another driver using facade
$response = Httplug::driver('curl')->sendRequest($request)
$ composer test
Please see our contributing guide.
If you discover any security related issues, please contact us at [email protected].
The MIT License (MIT). Please see License File for more information.