在我的开发过程中,我的代码运行正常。当我推送到我的服务器时,它变成了错误。
cURL 错误 6:无法解析主机:http(请参阅 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('/');
}
有什么解决办法吗?
谢谢
最佳答案
我的解决方案是清除 Artisan 中所有类型的缓存。
一起运行这些命令:
php artisan route:clear
php artisan config:clear
php artisan cache:clear
关于php - Laravel guzzle cURL 错误 6 : Could not resolve host: http (see http://curl. haxx.se/libcurl/c/libcurl-errors.html),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38909026/