Giter Club home page Giter Club logo

php-gist-api's People

Contributors

akshay9 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

kcko bennychange

php-gist-api's Issues

Array is not a string.

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) . '
';

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.