guzzle 发起http请求与https请求的区别,发起https请求时,需要在构造函数中传入一个配置项,

具体代码如下:

 //发起请求
        $client = new Client(['timeout' => 5, 'verify' => false]);

        $response=$client->get($url,);
        $body = (string)$response->getBody();
        $arr = json_decode($body, true);

这个配置项就是,'verify'=>false  ,添加此配置项  即不检查  ssl证书。

相关文章:

  • 2022-02-23
  • 2021-11-09
  • 2021-11-09
  • 2022-12-23
  • 2021-11-13
  • 2021-08-15
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-02
  • 2022-12-23
  • 2021-11-16
相关资源
相似解决方案