akshay9 / php-gist-api Goto Github PK
View Code? Open in Web Editor NEWGithub Gists PHP API is a light-weight object Oriented wrapper for Github Gist API.
Github Gists PHP API is a light-weight object Oriented wrapper for Github Gist API.
Error:
array (
'header' =>
array (
'http_code' => 'HTTP/1.1 422 Unprocessable Entity',
'Date' => 'Fri, 28 Jun 2019 14:39:03 GMT',
'Content-Type' => 'application/json; charset=utf-8',
'Content-Length' => '190',
'Server' => 'GitHub.com',
'Status' => '422 Unprocessable Entity',
'X-RateLimit-Limit' => '5000',
'X-RateLimit-Remaining' => '4999',
'X-RateLimit-Reset' => '1561736342',
'X-GitHub-Media-Type' => 'github.v3; format=json',
'Access-Control-Expose-Headers' => 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type',
'Access-Control-Allow-Origin' => '*',
'Strict-Transport-Security' => 'max-age=31536000; includeSubdomains; preload',
'X-Frame-Options' => 'deny',
'X-Content-Type-Options' => 'nosniff',
'X-XSS-Protection' => '1; mode=block',
'Referrer-Policy' => 'origin-when-cross-origin, strict-origin-when-cross-origin',
'Content-Security-Policy' => 'default-src 'none'',
'X-GitHub-Request-Id' => 'C4CF:46FFE:2D75543:38F9D80:5D162686',
),
'body' =>
array (
'message' => 'Invalid request.
For 'properties/content', {"content"=>"Some Random Content"} is not a string.',
'documentation_url' => 'https://developer.github.com/v3/gists/#create-a-gist',
),
'raw' => 'HTTP/1.1 422 Unprocessable Entity
Date: Fri, 28 Jun 2019 14:39:03 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 190
Server: GitHub.com
Status: 422 Unprocessable Entity
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
X-RateLimit-Reset: 1561736342
X-GitHub-Media-Type: github.v3; format=json
Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type
Access-Control-Allow-Origin: *
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Frame-Options: deny
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
Content-Security-Policy: default-src 'none'
X-GitHub-Request-Id: C4CF:46FFE:2D75543:38F9D80:5D162686
{"message":"Invalid request.\n\nFor 'properties/content', {\"content\"=>\"Some Random Content\"} is not a string.","documentation_url":"https://developer.github.com/v3/gists/#create-a-gist"}',
)
Script:
include_once('includes/gist_api.php');
$gistAPI = new gistAPI('xxx', 'xxxx');
function create_githubgist($text, $title, $public = false) {
global $gistAPI;
$filesArray = array("file1.txt" => ["content" => "Some Random Content"]);
$newGist = $gistAPI->createGist($filesArray, 'Create by TEST', $public);
return $newGist;
}
$image_githubgist = create_githubgist('tEST', 'testtest', false);
/var_dump($image_githubgist);/
echo '
' . var_export($image_githubgist, true) . '';
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.