Skip to content

Instantly share code, notes, and snippets.

@dshafik
Created April 25, 2012 02:01
Show Gist options
  • Save dshafik/2485502 to your computer and use it in GitHub Desktop.
Save dshafik/2485502 to your computer and use it in GitHub Desktop.
Code samples for "Mimetypes (and APIs)" at <http://daveyshafik.com/archives/35507-mimetypes-and-apis.html>
/*
$ http GET https://api.github.com/users/dshafik/repos
HTTP/1.1 200 OK
Server: nginx/1.0.13
Date: Wed, 25 Apr 2012 01:57:50 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Status: 200 OK
X-RateLimit-Limit: 5000
ETag: "89d5a053b7da615c2f01ecd546fceb21"
X-RateLimit-Remaining: 4997
Content-Encoding: gzip
*/
[
{
"clone_url": "https://github.com/dshafik/frapi.git",
"created_at": "2011-11-16T05:29:31Z",
"description": "FRAPI is an API Open Source framework, run it within your hosting environment parallel to your web app, mobile service or legacy system.",
"fork": true,
"forks": 0,
"git_url": "git://github.com/dshafik/frapi.git",
"has_downloads": true,
"has_issues": false,
"has_wiki": true,
"homepage": "http://getfrapi.com",
"html_url": "https://github.com/dshafik/frapi",
"id": 2785805,
"language": "PHP",
"master_branch": "master",
"mirror_url": null,
"name": "frapi",
"open_issues": 0,
"owner": {
"avatar_url": "https://secure.gravatar.com/avatar/3f06417f98ea87a7abe0fa9d1857495b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
"gravatar_id": "3f06417f98ea87a7abe0fa9d1857495b",
"id": 58074,
"login": "dshafik",
"url": "https://api.github.com/users/dshafik"
},
"private": false,
"pushed_at": "2012-04-24T17:12:30Z",
"size": 208,
"ssh_url": "[email protected]:dshafik/frapi.git",
"svn_url": "https://github.com/dshafik/frapi",
"updated_at": "2012-04-24T17:12:30Z",
"url": "https://api.github.com/repos/dshafik/frapi",
"watchers": 1
},
...
]
$ http GET https://api.github.com/users/dshafik/repos "Accept:application/vnd.github.3.full+json"
HTTP/1.1 200 OK
Server: nginx/1.0.13
Date: Wed, 25 Apr 2012 02:54:16 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Status: 200 OK
X-RateLimit-Limit: 5000
ETag: "612ba85efed472a21c39dc72626f0914"
X-RateLimit-Remaining: 4996
Content-Encoding: gzip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment