yuppyweb / http-service-client
dev-main
2023-08-30 16:22 UTC
Requires
- php: ^8.2
- guzzlehttp/psr7: ^2.6
- psr/http-client: ^1.0
Requires (Dev)
- guzzlehttp/guzzle: ^7.8
- phpunit/phpunit: ^10.3
This package is not auto-updated.
Last update: 2024-04-24 13:43:17 UTC
README
composer config minimum-stability dev
composer require yuppyweb/http-service-client
How to use
use GuzzleHttp\Client;
use HttpServiceClient\Client\Comments;
use HttpServiceClient\Handler\RequestHandler;
use HttpServiceClient\Model\Comment;
try {
$comments = new Comments(
new RequestHandler(
'https://example.com',
new Client()
)
);
$comments->get(new Comment(1));
$comments->getAll();
$comments->create(new Comment(name: 'name', text: 'text'));
$comments->update(new Comment(1, 'name', 'text'));
$comments->delete(new Comment(1));
} catch (\Throwable $t) {
}
Run tests
composer test