Package Data | |
---|---|
Maintainer Username: | dbu |
Maintainer Contact: | mathieu.santostefano@gmail.com (Mathieu Santo Stefano--Féron) |
Package Create Date: | 2016-02-19 |
Package Last Update: | 2020-06-05 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-23 03:13:00 |
Package Statistics | |
---|---|
Total Downloads: | 110,046 |
Monthly Downloads: | 2 |
Daily Downloads: | 0 |
Total Stars: | 12 |
Total Watchers: | 8 |
Total Forks: | 3 |
Total Open Issues: | 5 |
Via Composer
$ composer require php-http/laravel-httplug
Add serviceprovider and alias
<?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 security@php-http.org.
The MIT License (MIT). Please see License File for more information.