在我的开发中,我的代码工作正常。当我推送到我的服务器时,它变成了错误。Laravel guzzle cURL错误6:无法解析主机:http(请参阅http://curl.haxx.se/libcurl/c/libcurl-errors.html)
cURL error 6: Could not resolve host: http (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
这里是我的代码:
use GuzzleHttp\Client;
try {
$client = new Client();
$client->request('POST', env('API_DOMAIN') . '/v1/user/auth/verified_email',
['headers' => ['Authorization' => 'cm9vcGlhLnVzZXIud2ViOkY0RVN3VXJheS1qVVB1a18='],
'query' => ['token' => $key]]);
return redirect('/')->with('status', 'Your email has been verified. Thanks!')->with('statusType', 'success');
} catch (ConnectException $e) {
Log::error($e);
return redirect('/');
}
任何解决方案?
感谢
你在.env中设置了API_DOMAIN吗? – xmhafiz
重新启动服务器。两个小时后,这对我来说很有用。 – gras
我重新启动服务器,问题再次发生。 – user3494047