Closed Ridder90 closed 7 years ago
Have a look at the HTTPlug documentation: http://docs.php-http.org/en/latest/clients/guzzle5-adapter.html#usage
You need to create the Guzzle client and configure it. Then you need the Guzzle5 adapter. Also, it seams that you are mixing Guzzle versions. Decide if you want to use Guzzle5 or Guzzle6.
Hi and thanks for you response! I forgot to answer you...I ended up with hardcoding the verifiypeer to false on my local environment. Still getting "paramater must be instance of GuzzleHttp\ClientInterface message". Even after following the docs.
For future reference here is what you should do:
$linkedIn = new Happyr\LinkedIn\LinkedIn('client_id', 'client_secret');
$linkedIn->setHttpClient(new \Http\Adapter\Guzzle6\Client(new \GuzzleHttp\Client(['curl' => [CURLOPT_SSL_VERIFYPEER => false ]])));
You basically need to create a Client instance, pass it to the Client Adapter instance and pass that into the LinkedIn instance.
Why? because composition. This whole Guzzle thing is a mess!
This is now a part of HTTPlugs documentation. http://docs.php-http.org/en/latest/clients/guzzle6-adapter.html
Bug? no New Feature? no Are you using composer? yes
Hi! I'm trying to use this client. Unfortunatly i keep getting a fatal error because of my self signed certificate.
I know you should be able to disable the verify peer option. What i have tried is.
$guzzleClient = new \GuzzleHttp\Client(array( 'curl' => array( CURLOPT_SSL_VERIFYPEER => false, ), )); $li->setHttpClient($guzzleClient);
and
$guzzle = new Http\Adapter\Guzzle5\Client(['curl' => array( CURLOPT_SSL_VERIFYPEER => false ) ]); $li->setHttpClient($guzzle);
which gives me Class 'Http\Adapter\Guzzle6\Client' not found or paramater must be instance of GuzzleHttp\ClientInterface.
Please advice.