freddymx / curl

a friendly curl wrapper for php

Home Page:https://github.com/dcai/curl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

curl wrapper class for PHP

A PHP wrapper class to simplify PHP cURL Library.

How to use

Following code shows how to use this class

$http = new dcai\curl;
// enable cache
$http = new dcai\curl(array('cache'=>true));
// enable cookie
$http = new dcai\curl(array('cookie'=>true));
// enable proxy
$http = new dcai\curl(array('proxy'=>true));

// HTTP GET
$response = $http->get('http://example.com');
// HTTP POST
$response = $http->post('http://example.com/', array('q'=>'words', 'name'=>'moodle'));
// POST RAW
$xml = '<action>perform</action>';
$response = $http->post('http://example.com/', $xml);
// HTTP PUT
$response = $http->put('http://example.com/', array('file'=>'/var/www/test.txt');

Build Status

About

a friendly curl wrapper for php

https://github.com/dcai/curl

License:GNU General Public License v3.0


Languages

Language:PHP 98.3%Language:JavaScript 1.3%Language:Makefile 0.4%