I\'m using the requests library (http://requests.ryanmccue.info/) for PHP.
I installed composer and added the following Json configuration in composer.json
There is a simple way to use Requests for PHP with Codeigniter.
You may follow these few easy steps.
Step - 1
Unzip latest Requests for PHP zip and copy the contents of the library directory to {codeigniter_directory}/application/third_party/Request-{version}
for example you have Requests for PHP 1.6.0 and your CI project is in /usr/sites/www/myciproject
then copy the files to /usr/sites/www/myciproject/application/third_party/Requests-1.6.0
.
Step - 2
Create a file PHPRequests.php
in {codeigniter_directory}/application/libraries
with this content
Step - 3
In your controller you can use Requests by loading PHPRequests library we created in previous step.
$this->load->library('PHPRequests');
Like this test function
public function test()
{
$this->load->library('PHPRequests');
$response = Requests::get('https://github.com/timeline.json');
var_dump($response->body);
}
Hope this will help.