Jump to content

FYI: Using WHMCS library Guzzle for remote API connections


drosendo

Recommended Posts

Hi everyone,

 

Here goes a small contribution:

 

ever wanted to connect to a remote API?

 

Add

 

//Documentation: http://guzzle3.readthedocs.io/docs.html
//Declare an alias to Guzzle in your project file's use Client to access Guzzle: 

use \Guzzle\Http\Client;

$client = Client('https://' . $url . '/api/{version}', array(
           'version' => 'v1',
           'request.options' => array(
               'auth' => array($user, $pass, 'Basic'),
           )
       ));

 

Anyone contributing on this?

 

All the best!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated