summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMateusz Jaworski <niespammnie@gmail.com>2014-07-15 09:55:01 +0200
committerMateusz Jaworski <niespammnie@gmail.com>2014-07-15 09:55:01 +0200
commit47cd8fec299c43452de297549e5ddfe56388c1ed (patch)
tree28b751c5cd9565562ce39705e0c751a31e1af198
parent2ebe98e90e172b2c824f4263b9367346392227c5 (diff)
downloadphp.curl-47cd8fec299c43452de297549e5ddfe56388c1ed.zip
php.curl-47cd8fec299c43452de297549e5ddfe56388c1ed.tar.gz
php.curl-47cd8fec299c43452de297549e5ddfe56388c1ed.tar.bz2
Update README.md
Doc fix after pull request
-rw-r--r--README.md12
1 files changed, 6 insertions, 6 deletions
diff --git a/README.md b/README.md
index dfc01d3..60c2620 100644
--- a/README.md
+++ b/README.md
@@ -27,20 +27,20 @@ Usage
Simple GET
```
$pcurl = new PCurl('http://www.google.pl');
-$response = $pcurl->get('/');
+$response = $pcurl->get('/')->getBody();
```
Simple GET via HTTPS with certificate verification (more examples in test package)
```
$pcurl = new PCurl('https://www.google.pl');
$pcurl->useSSLCertificate(<path to crt/pem file>);
-$response = $pcurl->get('/');
+$response = $pcurl->get('/')->getBody();
```
and a similar example without it
```
$pcurl = new PCurl('https://www.google.pl');
$pcurl->ignoreSSLCertificate();
-$response = $pcurl->get('/');
+$response = $pcurl->get('/')->getBody();
```
Sample POST
@@ -50,7 +50,7 @@ $pcurl->proxy(host, port);
$pcurl->auth(user, pass);
$pcurl->header('Cache-Control: no-cache');
$pcurl->contentType('application/xml');
-$response = $pcurl->post('/igipigiel/xml', '<a>makapaka</a>');
+$response = $pcurl->post('/igipigiel/xml', '<a>makapaka</a>')->getBody();
```
### PJsonCurl.php
@@ -59,7 +59,7 @@ Class similar to PCurl, the only difference is that the input/output is passed t
```
$pcurl = new PJsonCurl('http://www.app.com/json');
$response = $pcurl->put('/', array('a' => 'b'));
-echo $response['c'];
+echo $response->getBody()['c'];
```
### PObjectCurl.php
@@ -70,6 +70,6 @@ Class similar to PJsonCurl, the difference is that the input/output is passed th
$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);
+$preetyObject = $pcurl->put('/', $uglyObject)->getBody();
```
Enjoy!