diff options
author | purplecode <niespammnie@gmail.com> | 2013-12-08 19:43:20 +0100 |
---|---|---|
committer | purplecode <niespammnie@gmail.com> | 2013-12-08 19:43:20 +0100 |
commit | 082a651599ab37c68c6f1d701fb9fbfcb1eceefe (patch) | |
tree | 72c5cb6dbc3d816a58b3b0fc7e605d405a44e99c /README.md | |
parent | b3dd84112bc841f071d4df0345cef5e8194fc148 (diff) | |
download | php.curl-082a651599ab37c68c6f1d701fb9fbfcb1eceefe.zip php.curl-082a651599ab37c68c6f1d701fb9fbfcb1eceefe.tar.gz php.curl-082a651599ab37c68c6f1d701fb9fbfcb1eceefe.tar.bz2 |
Update README.md
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -18,4 +18,35 @@ To install PCurl, use the following composer `require` statement: ``` +# Usage + +Simple GET +``` +$pcurl = new PCurl('http://www.google.pl'); +$response = $cut->get('/'); +``` + +Simple GET via HTTPS with certificate verification (more examples in test package) +``` +$pcurl = new PCurl('https://www.google.pl'); +$cut->useSSLCertificate(<path to crt/pem file>); +$response = $cut->get('/'); +``` +and a similar example without it +``` +$pcurl = new PCurl('https://www.google.pl'); +$cut->ignoreSSLCertificate(); +$response = $cut->get('/'); +``` + +Sample POST +``` +$pcurl = new PCurl('http://some.fancy.page'); +$cut->proxy(host, port); +$cut->auth(user, pass); +$cut->header('Cache-Control: no-cache'); +$cut->contentType('application/xml'); +$response = $cut->get('/'); +``` + Enjoy! |