Guzzle returns cURL error 3: malformed

后端 未结 3 628
庸人自扰
庸人自扰 2020-12-15 16:31

I want to try out the guzzle library and am following through their quickstart tutorial to make http requests to an api.

Yet it doesn\'t seem to work, because I get

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-15 16:48

    You should not have this call:

    $client->get('/', ['verify' => true]);
    

    That is what is throwing the error. The third line is okay.

    The error is means what it says. The url is malformed. In my case on initialization of the Client, I used base_url instead of base_uri. So if you run into this error make sure your url is properly specified.

提交回复
热议问题