While it's great that you can expose certain functionality of your application via web services, you'll also want to consume services of your own or by other third parties. CakePHP comes equipped with a very useful HTTP socket class, which allows you to easily interact with other resources.
In this recipe, we'll consume the service from our previous example, which exposes its interface as JSON, and see how easy it is to quickly get the results you need.
For this recipe, we'll use a simple test controller to interact with our API. Create a file named
app/Controller/ with the following content:
<?php App::uses('AppController', 'Controller'); App::uses('HttpSocket', 'Network/Http'); class ServiceController ...