A curl library for Yii
PHP
Switch branches/tags
Nothing to show
Latest commit cd4c10c Feb 24, 2015 @phpnode phpnode Merge pull request #6 from PeoplePerHour/master
Update ACurl.php

README.md

NOTE: No Longer Maintained

This package is no longer being maintained, use http://guzzlephp.org/ instead!


Introduction

A curl wrapper for Yii, allows easier access to curl functions.

Example usage

To grab a url:

$curl = new ACurl();
$data = $curl->get("http://www.google.com/")->data;
echo $data;

To retrieve just the headers for a URL:

$curl = new ACurl();
$headers = $curl->head("http://www.google.com/")->headers;
print_r($headers);

To post data to a URL:

$curl = new ACurl();
$response = $curl->post("http://example.com/",array("key" => "value"))->data;
echo $response;

To load JSON from a URL:

$curl = new ACurl();
$response = $curl->get("http://www.example.com/test.json")->fromJSON();
print_r($response);