summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md35
1 files changed, 34 insertions, 1 deletions
diff --git a/README.md b/README.md
index 3cfab18..c379810 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
**PCurl** is a PHP client library for [RESTful](http://en.wikipedia.org/wiki/Representational_State_Transfer)
web services.
-PCurl supports GET/POST/PUT/DELETE request methods. Unlike other similar libaries supoprts also HTTPS certificates verification.
+PCurl supports GET/POST/PUT/DELETE request methods. Unlike other similar libaries supports also HTTPS certificates verification.
Composer Installation
------------
@@ -17,5 +17,38 @@ To install PCurl, use the following composer `require` statement:
}
```
+or just copy-paste content of `src/` to your `libs`.
+
+Usage
+------------
+
+Simple GET
+```
+$pcurl = new PCurl('http://www.google.pl');
+$response = $pcurl->get('/');
+```
+
+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('/');
+```
+and a similar example without it
+```
+$pcurl = new PCurl('https://www.google.pl');
+$pcurl->ignoreSSLCertificate();
+$response = $pcurl->get('/');
+```
+
+Sample POST
+```
+$pcurl = new PCurl('http://some.fancy.page');
+$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>');
+```
Enjoy!