Merge pull request #52 from zborboa-google/master

Add Github Gist example
This commit is contained in:
Zach Borboa
2014-05-14 20:53:13 -07:00
+21
View File
@@ -0,0 +1,21 @@
<?php
require '../src/Curl.class.php';
$content = <<<EOF
<?php
echo 'hello, world';
EOF;
$curl = new Curl();
$curl->post('https://api.github.com/gists', json_encode(array(
'description' => 'PHP-Curl-Class test.',
'public' => 'true',
'files' => array(
'Untitled.php' => array(
'content' => $content,
),
),
)));
echo 'Gist created at ' . $curl->response->html_url . "\n";