How to use HttpSocket instead of cURL in CakePHP 2

While browsing my Google Analytics, I got surprised how many people are still searching for CakePHP cURL solutions while CakePHP has it own build-in class (HttpSocket) with the very same functionality.

The main argument I hear for using cURL for your API requests, is because it has so many nice features. I like cURL and it helps me a lot, but I rather use what’s inside the CakePHP framework. HttpSocket has probably all the features you actually need and use. In this article I will show you how to refactor your app from cURL to CakePHP’s HttpSocket.