mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-09-19 06:46:45 +00:00
Merge pull request #52 from zborboa-google/master
Add Github Gist example
This commit is contained in:
@@ -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";
|
||||
Reference in New Issue
Block a user