I have a symfony application with two controllers. One of the controllers randomly return an element of an array, like this:
$responses = array("foo", "bar", "baz");
return new JsonResponse($responses[array_rand($responses)]);
The other one has a form and if that form is valid and is submitted it should create a new guzzle client and display one of the array elements from the other controller:
...
if ($form->isSubmitted() && $form->isValid()) {
$client = new Client([
'base_uri' => 'foo.local',
]);
$response = $client->request('GET', '/bar');
This results in a cURL error 6: Could not resolve host.
I do have nginx up and running and can access both controllers separately via their routes.
I could not find any solutions, hope someone can help me out with some ideas on this.
'base_uri' => 'http://foo.local',