dcai/curl

A friendly curl wrapper for PHP.

Maintainers

Details

github.com/dcai/curl

Source

Issues

Installs: 8 516

Dependents: 1

Suggesters: 0

Security: 0

Stars: 29

Watchers: 4

Forks: 30

Open Issues: 0

pkg:composer/dcai/curl

0.2.2 2018-06-11 12:09 UTC

This package is not auto-updated.

Last update: 2025-10-09 22:04:24 UTC


README

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