Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mops1k/lazy-http-client-bundle
Lazy http client bundle
https://github.com/mops1k/lazy-http-client-bundle
Last synced: about 1 month ago
JSON representation
Lazy http client bundle
- Host: GitHub
- URL: https://github.com/mops1k/lazy-http-client-bundle
- Owner: mops1k
- License: mit
- Created: 2019-08-02T11:23:44.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-11-25T10:24:51.000Z (almost 5 years ago)
- Last Synced: 2024-09-30T17:21:36.222Z (about 2 months ago)
- Language: PHP
- Size: 51.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Lazy Http Client Bundle
=====
This bundle provides lazy http client for symfony 4.1 and above.
Lazy means that before you are not using any response methods, request doesn't execute.#### Instructions
- [Installation](Resources/doc/installation.md)
- [Example client](Resources/doc/client.md)
- [Example response](Resources/doc/response.md)
- [Example query](Resources/doc/query.md)#### Usage
Simple usage example```php
use LazyHttpClientBundle\Client\Manager;
use App\ReqresFakeApi\Client;
use App\ReqresFakeApi\Query\ListUsersQuery;
use App\ReqresFakeApi\Query\SingleUserQuery;$client = $this->get(Manager::class)->get(Client::class);
$client->use(ListUsersQuery::class);
$listResult = $client->execute();$client->getRequest()->getParameters()->set('page', 2);
$listResult2 = $client->execute();echo $listResult->getContent();
echo $listResult2->getContent();
echo $listResult2->getStatusCode();```