Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace AppBundleController;
- use SymfonyBundleFrameworkBundleControllerController;
- use SensioBundleFrameworkExtraBundleConfigurationRoute;
- use SymfonyComponentHttpFoundationResponse;
- use SymfonyComponentHttpFoundationRequest;
- use PsrHttpMessageResponseInterface;
- use GuzzleHttpClient;
- class ScheduleController extends Controller {
- /**
- * @Route("/schedule")
- */
- public function getJobs() {
- // Create a client with a base URI
- $client = new GuzzleHttpClient(['base_uri' => 'http://my.external.api/']);
- // Send a request to http://my.external.api/site/67/module/1449/item
- $response = $client->request('GET', 'site/67/module/1449/item', ['auth' => ['*****', '*****']]);
- return $this->json(array($response));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement