https://github.com/php-http/laravel-httplug
Laravel package for HTTPlug
https://github.com/php-http/laravel-httplug
Last synced: 9 months ago
JSON representation
Laravel package for HTTPlug
- Host: GitHub
- URL: https://github.com/php-http/laravel-httplug
- Owner: php-http
- License: mit
- Created: 2016-02-19T15:42:10.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2020-06-05T08:30:37.000Z (over 5 years ago)
- Last Synced: 2024-08-05T17:33:59.219Z (over 1 year ago)
- Language: PHP
- Size: 17.6 KB
- Stars: 12
- Watchers: 8
- Forks: 3
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING
- License: LICENSE
Awesome Lists containing this project
README
# Laravel-Httplug
[](https://github.com/php-http/laravel-httplug/releases)
[](LICENSE)
[](https://travis-ci.org/php-http/laravel-httplug)
[](https://scrutinizer-ci.com/g/php-http/laravel-httplug)
[](https://scrutinizer-ci.com/g/php-http/laravel-httplug)
[](https://packagist.org/packages/php-http/laravel-httplug)
## Install
Via Composer
``` bash
$ 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
[
...,
...,
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"
```
## Usage
```php
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)
```
## Testing
``` bash
$ composer test
```
## Contributing
Please see our [contributing guide](http://docs.php-http.org/en/latest/development/contributing.html).
## Security
If you discover any security related issues, please contact us at [security@php-http.org](mailto:security@php-http.org).
## License
The MIT License (MIT). Please see [License File](LICENSE) for more information.