backend2-plus/connect-rest-api-bundle
HttpClient usages across controllers/services with a single, configurable service layer, improving consistency and testability.Adopt if:
Look elsewhere if:
symfony/http-client directly or libraries like Guzzle).*"This bundle lets our Symfony backend connect to external APIs 5x faster than building custom HTTP clients. For example:
*"This is a lightweight, opinionated wrapper around Symfony’s HTTP Client that:
.env + YAML config (no hardcoding).HttpClient calls with one-liners (e.g., $service->get('https://api.example.com/data')).*"If you’re tired of writing the same HttpClient code for every API call, this bundle:
// Before (verbose)
$client = new Client();
$response = $client->request('GET', 'https://api.example.com/users', [
'auth_basic' => ['user', 'pass'],
'headers' => ['Accept' => 'application/json'],
]);
// After (clean)
$response = $this->connectRestApiService->get('https://api.example.com/users');
Downside: No OAuth2, but we can add it later if needed."*
How can I help you explore Laravel packages today?