Skip to content

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Huber committed May 7, 2008
1 parent c7f495a commit 8fc9288
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Expand Up @@ -7,6 +7,9 @@
2008-05-07 Sean Huber (shuber@huberry.com)
* Updated README

2008-05-07 Sean Huber (shuber@huberry.com)
* Updated README

2008-05-07 Sean Huber (shuber@huberry.com)
* Fixed Bug: Custom headers were not being sent correctly for requests
* Updated README
Expand Down
22 changes: 19 additions & 3 deletions README.markdown
@@ -1,11 +1,12 @@
Curl, CurlResponse
==================

Author: Sean Huber [http://github.com/shuber](http://github.com/shuber)

Description
-----------

A basic CURL wrapper written in PHP
See [http://php.net/curl](http://php.net/curl) for more information about the libcurl extension for PHP
A basic CURL wrapper written in PHP (see [http://php.net/curl](http://php.net/curl) for more information about the libcurl extension for PHP)


Installation
Expand All @@ -26,7 +27,22 @@ Simply require and initialize the Curl class like so

### Performing a Request

TODO
The Curl object supports 4 types of requests: GET, POST, PUT, and DELETE. You must specify a url to request and optionally specify an associative array of variables to send along with it.

$response = $curl->get($url, $vars = array()); # The Curl object will append the array of $vars to the $url as a query string
$response = $curl->post($url, $vars = array());
$response = $curl->put($url, $vars = array());
$response = $curl->delete($url, $vars = array());

Examples

$response = $curl->get('google.com?q=test');

$response = $curl->get('google.com?q=test', array('some_variable' => 'some_value')); # The Curl object will append '&some_variable=some_value' to the url

$response = $curl->post('test.com/posts', array('title' => 'Test', 'body' => 'This is a test'));

All requests return a CurlResponse object (see below)

### The CurlResponse Object

Expand Down

0 comments on commit 8fc9288

Please sign in to comment.