mops1k / lazy-http-client-bundle
Bundle for making async `lazy` http requests
Installs: 25
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^7.1.3
- ext-json: *
- guzzlehttp/guzzle: ~6.0
- ocramius/proxy-manager: ^2.2
- symfony/framework-bundle: ~4.1|~4.2|~4.3|~4.4|~5.0
- symfony/monolog-bundle: ^3.4
README
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
Usage
Simple usage example
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();