mirror of
https://github.com/moparisthebest/SickRage
synced 2024-11-17 06:45:05 -05:00
23 lines
7.0 KiB
Plaintext
23 lines
7.0 KiB
Plaintext
https
|
|
GET
|
|
api.github.com
|
|
None
|
|
/gists/2729810
|
|
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
|
|
null
|
|
200
|
|
[('status', '200 OK'), ('x-ratelimit-remaining', '4970'), ('content-length', '3280'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"b01fb6ac81527f99db9f6f586b048ee3"'), ('date', 'Sat, 19 May 2012 06:58:15 GMT'), ('content-type', 'application/json; charset=utf-8')]
|
|
{"updated_at":"2012-02-29T16:47:12Z","forks":[],"url":"https://api.github.com/gists/2729810","comments":0,"public":true,"git_pull_url":"git://gist.github.com/2729810.git","files":{"fail_github.py":{"type":"application/python","raw_url":"https://gist.github.com/raw/2729810/2fb3aa84e0efa50dc0f4c18b5df5b7b9ab27076b/fail_github.py","size":1636,"filename":"fail_github.py","content":"import httplib\nimport base64\nimport json\n\nlogin = \"\"\npassword = \"\"\norgName = \"\"\nrepoName = \"FailGithubApi\"\n\ndef doRequest( verb, url, input ):\n input = json.dumps( input )\n cnx = httplib.HTTPSConnection( \"api.github.com\", strict = True )\n cnx.request( verb, url, input, { \"Authorization\" : \"Basic \" + base64.b64encode( login + \":\" + password ).replace( '\\n', '' ) } )\n response = cnx.getresponse()\n status = response.status\n output = response.read()\n cnx.close()\n print verb, url, input, \"=>\", status, output\n print\n if status < 200 or status >= 300:\n exit( 1 )\n return json.loads( output )\n\n# Create a repo\ndoRequest( \"POST\", \"/user/repos\", { \"name\": repoName } )\n\n# Create a blob, a tree, a commit and the master branch\nb = doRequest(\n \"POST\", \"/repos/%s/%s/git/blobs\" % ( login, repoName ),\n { \"content\": \"Content of the blob\", \"encoding\": \"latin1\" }\n)\nt = doRequest(\n \"POST\", \"/repos/%s/%s/git/trees\" % ( login, repoName ),\n { \"tree\" : [ { \"path\": \"foo.bar\", \"type\": \"blob\", \"mode\": \"100644\", \"sha\": b[\"sha\"] } ] }\n)\nc = doRequest(\n \"POST\", \"/repos/%s/%s/git/commits\" % ( login, repoName ),\n { \"parents\": [], \"message\": \"Message of the commit\", \"tree\": t[\"sha\"] }\n)\ndoRequest(\n \"POST\", \"/repos/%s/%s/git/refs\" % ( login, repoName ),\n { \"ref\": \"refs/heads/master\", \"sha\": c[\"sha\"] }\n)\n\n# Fork the repo\ndoRequest( \"POST\", \"/repos/%s/%s/forks?org=%s\" % ( login, repoName, orgName ), None )\n\n# Create a new blob => BOOM error 500\ndoRequest(\n \"POST\", \"/repos/%s/%s/git/blobs\" % ( orgName, repoName ),\n { \"content\": \"Content of the new blob\", \"encoding\": \"latin1\" }\n)\n","language":"Python"}},"html_url":"https://gist.github.com/2729810","git_push_url":"git@gist.github.com:2729810.git","user":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"description":"How to error 500 Github API v3, as requested by Rick (GitHub Staff)","created_at":"2012-02-29T16:47:12Z","id":"2729810","history":[{"url":"https://api.github.com/gists/2729810/a40de483e42ba33bda308371c0ef8383db73be9e","change_status":{"deletions":0,"additions":52,"total":52},"committed_at":"2012-02-29T16:47:12Z","version":"a40de483e42ba33bda308371c0ef8383db73be9e","user":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146}}]}
|
|
|
|
https
|
|
PATCH
|
|
api.github.com
|
|
None
|
|
/gists/2729810
|
|
{'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
|
|
{"files": {"barbaz.txt": {"content": "File also created by PyGithub"}}, "description": "Description edited by PyGithub"}
|
|
200
|
|
[('status', '200 OK'), ('x-ratelimit-remaining', '4994'), ('content-length', '2759'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"14d4466c0580c6f8e9be17f81eb1c3b0"'), ('date', 'Sat, 19 May 2012 07:06:10 GMT'), ('content-type', 'application/json; charset=utf-8')]
|
|
{"updated_at":"2012-05-19T07:06:10Z","forks":[],"url":"https://api.github.com/gists/2729810","comments":0,"public":true,"git_pull_url":"git://gist.github.com/2729810.git","files":{"barbaz.txt":{"type":"text/plain","raw_url":"https://gist.github.com/raw/2729810/92be1df4e473d2541c5c166ad145a39d0324de8b/barbaz.txt","size":29,"filename":"barbaz.txt","content":"File also created by PyGithub","language":"Text"},"foobar.txt":{"type":"text/plain","raw_url":"https://gist.github.com/raw/2729810/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt","size":24,"filename":"foobar.txt","content":"File created by PyGithub","language":"Text"}},"html_url":"https://gist.github.com/2729810","git_push_url":"git@gist.github.com:2729810.git","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146},"description":"Description edited by PyGithub","created_at":"2012-05-19T07:00:58Z","id":"2729810","history":[{"url":"https://api.github.com/gists/2729810/67524fb6eb4883d979e8b4cf133003fa81a6a472","change_status":{"deletions":0,"additions":0,"total":0},"committed_at":"2012-05-19T07:06:10Z","version":"67524fb6eb4883d979e8b4cf133003fa81a6a472","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146}},{"url":"https://api.github.com/gists/2729810/e730170a9599696a9d776f8bb5028b35f937b6de","change_status":{"deletions":0,"additions":1,"total":1},"committed_at":"2012-05-19T07:04:31Z","version":"e730170a9599696a9d776f8bb5028b35f937b6de","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146}},{"url":"https://api.github.com/gists/2729810/35deb29ab1caf4c68c03d8244ad674b56de01a5c","change_status":{"deletions":0,"additions":1,"total":1},"committed_at":"2012-05-19T07:00:58Z","version":"35deb29ab1caf4c68c03d8244ad674b56de01a5c","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146}}]}
|
|
|