summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpurplecode <niespammnie@gmail.com>2013-12-11 17:00:05 +0100
committerpurplecode <niespammnie@gmail.com>2013-12-11 17:00:05 +0100
commit9d0d9ea45aeedf531729680f9ce1d1141d308855 (patch)
treee2b11479299529ac9cf582bff5d9d922cf2ed970
parent64edc0e6d5e146dbe56b846677b2e2ff31eb371f (diff)
downloadphp.curl-9d0d9ea45aeedf531729680f9ce1d1141d308855.zip
php.curl-9d0d9ea45aeedf531729680f9ce1d1141d308855.tar.gz
php.curl-9d0d9ea45aeedf531729680f9ce1d1141d308855.tar.bz2
Update README.md
-rw-r--r--README.md21
1 files changed, 21 insertions, 0 deletions
diff --git a/README.md b/README.md
index c379810..dfc01d3 100644
--- a/README.md
+++ b/README.md
@@ -22,6 +22,8 @@ or just copy-paste content of `src/` to your `libs`.
Usage
------------
+### PCurl.php
+
Simple GET
```
$pcurl = new PCurl('http://www.google.pl');
@@ -51,4 +53,23 @@ $pcurl->contentType('application/xml');
$response = $pcurl->post('/igipigiel/xml', '<a>makapaka</a>');
```
+### PJsonCurl.php
+
+Class similar to PCurl, the only difference is that the input/output is passed through json_encode/json_decode.
+```
+$pcurl = new PJsonCurl('http://www.app.com/json');
+$response = $pcurl->put('/', array('a' => 'b'));
+echo $response['c'];
+```
+
+### PObjectCurl.php
+
+Class similar to PJsonCurl, the difference is that the input/output is passed through serialize/deserialize methods. Requires [JMS\Serializer](https://github.com/schmittjoh/serializer) library or [JMSSerializerBundle](https://github.com/schmittjoh/JMSSerializerBundle) Symfony2 bundle.
+
+```
+$pcurl = new PObjectCurl('http://www.prettifier.com/json', JMS\Serializer\SerializerInterface $serializer);
+$pcurl->responseClass('My\App\Preety');
+$uglyObject = new My\App\Ugly();
+$preetyObject = $pcurl->put('/', $uglyObject);
+```
Enjoy!