buzzina-social / http
Http Client
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 4 275
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 2
Type:libraries
Requires
- php: >=7.1
- buzzina-social/traits: ^1.0
- guzzlehttp/guzzle: ^6.3
Requires (Dev)
- codacy/coverage: ^1.2
- mockery/mockery: ^0.9.9
- phpunit/phpunit: 5.5.*
This package is auto-updated.
Last update: 2023-03-21 19:07:37 UTC
README
Installing
composer require buzzina-social/http
Using
require __DIR__.'/vendor/autoload.php'; class MoreClass extends \BuzzinaSocial\Http\Client { public function __construct() { $this->setHeaders( [ 'accept' => 'application/json', 'Content-Type' => 'application/json' ]); $this->setBaseURI('https://viacep.com.br/ws/'); parent::__construct(); } public function test() { return $this->get('01001000/json/'); } } try { $more_class = new MoreClass(); $more_class->test(); } catch (\Exception $e) {} print_r(json_decode($more_class->test()->getBody()));