安装使用composer
composer require guzzlehttp/guzzle
代码式例
use GuzzleHttpClient;
use GuzzleHttpExceptionRequestException;
public function index(){
$client = new GuzzleHttpClient();
$url = 'http://gadeas.top/api/dome';
// 发送一个异步请求
$promise = $client->requestAsync("GET",$url,["query"=>$data]);
// $promise->wait();//阻塞
}
概述 — Guzzle中文文档 (guzzle-cn.readthedocs.io)
本地请求 https 报错(cURL error 60)
找到Client/configureDefaults()把 ‘verify’ 改成 false,就可以了



