Curl error 6: Could not resolve host

Asked

Viewed 1,703 times

0

Good afternoon staff I am trying to perform an authentication test using the Guzzlehttp, which in turn uses the Curl under the table, with no mystery:

        $http = new \GuzzleHttp\Client;

        $response = $http->post('http://site.test/oauth/token', [
            'form_params' => [
                'grant_type' => 'password',
                'client_id' => '2',
                'client_secret' => 'client-secret',
                'username' => '[email protected]',
                'password' => 'senha',
                'scope' => '*',
            ],
        ]);

        dd($response);

but returns the error:

GuzzleHttp\Exception\ConnectException: cURL error 6: Could not resolve host: site.test

to create the development environment I am using the laradock with the following services:

Creating laradock_docker-in-docker_1 ... done

Creating laradock_mariadb_1 ... done

Creating laradock_workspace_1 ... done

Creating laradock_php-fpm_1 ... done

Creating laradock_apache2_1 ... done

and my file /etc/hosts this way:

127.0.0.1   localhost
127.0.1.1   thiago-340XAA-350XAA-550XAA
127.0.0.1   site.test

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Some good soul can tell me what I’m missing?

  • Solution -- https://stackoverflow.com/a/56929097/10569196 Cause -- https://github.com/laradock/laradock/issues/435#issuecomment-261746807

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.