Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Consume third party REST API Services

Hi All,

I need some guidance on how to consume 3rd party REST API services. Are there any examples availble? eg. consuming a twitter API service?

If anybody can point me in the right direction I would appreciate it.

Thanks!



30.9k
Accepted
answer


14.2k

Thanks, I will check it out.

Regards

C



14.2k

I cant get Guzzle to work, I followed the instructions but keep on getting :

Fatal error: Class 'Guzzle\Http\Client' not found in C:\localhost\tutorial\app\controllers\IndexController.php on line 12

I even updated composer after editing the composer.json file.

Any ideas?

You either need to bypass the Phalcon autoloader explicitely by include()-ing or require()-ing the Guzzle file, or configure the auto-loader to know where to look.



14.2k

Thanks quasipickle, this worked for me. I had to require() the vendor/autoloader.php file in my index.php and it worked.

Use :

  • Guzzle - A comprehensive HTTP client.
  • Buzz - Another HTTP client.
  • Requests - A simple HTTP library.
  • HTTPFul - A chainable HTTP client.
  • Goutte - A simple web scraper.

https://github.com/lorien/awesome-web-scraping/blob/master/php.md#web-scraping-frameworks