ebidtech / http-client
Http Client helper trait
Installs: 3 956
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 13
Forks: 0
Open Issues: 0
Requires
- php: >=5.3
- eso/ireflection: 0.1.*
- guzzle/guzzle: >=3.7.0,<3.9.0
Requires (Dev)
- jms/serializer: 0.14.0
- phpmd/phpmd: ~1.5.0
- phpunit/phpunit: 4.1.*
- satooshi/php-coveralls: dev-master
- squizlabs/php_codesniffer: 1.5.*
This package is not auto-updated.
Last update: 2024-11-19 03:58:03 UTC
README
Helper trait for creating HTTP Rest clients
Requirements
- PHP >= 5.3
Installation
The recommended way to install is through composer.
Just create a composer.json
file for your project:
{ "require": { "ebidtech/http-client": "@stable" } }
Tip: browse ebidtech/http-client
page to choose a stable version to use, avoid the @stable
meta constraint.
And run these two commands to install it:
$ curl -sS https://getcomposer.org/installer | php
$ composer install
Now you can add the autoloader, and you will have access to the library:
<?php require 'vendor/autoload.php';
Usage
<?php namespace XXX; use EBT\HttpClient\CreateTrait as HttpClientCreateTrait; use Guzzle\Http\Client as GuzzleHttpClient; class <HttpClient> { use HttpClientCreateTrait; /** * @var GuzzleHttpClient */ private $client; ... $this->client = $this->create($host, $userAgent, $config); }
Contributing
See CONTRIBUTING file.
Credits
- Ebidtech developer team, http-client
- All contributors
License
http-client library is released under the MIT License. See the bundled LICENSE file for details.