Skip to content

Instantly share code, notes, and snippets.

@simsicon
Created October 22, 2013 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simsicon/7102731 to your computer and use it in GitHub Desktop.
Save simsicon/7102731 to your computer and use it in GitHub Desktop.
RESTful API examples for Grit
Examples built with referenced from https://github.com/mojombo/grit/blob/master/lib/grit/repo.rb
POST /repos
PARAMS
bare: { type:Boolean, default:false }
repo_name: { type:String, required:true }
path: {type:String, required:true }
REQUEST EXMAPLE
{
"bare":true,
"repo_name":"gist",
"path":"awesome_user"
}
RESPONSE EXAMPLE
{
"result": true,
"data": {
"name": "gist",
"bare": true,
"path": "awesome_user/gist.git"
"filesize": 2035712
}
}
GET /repo
PARAMS
repo_name: { type:String, required:true }
path: { type:String, required:true }
REQUEST EXAMPLE
{
"repo_name": "gist",
"path": "awesome_user"
}
RESPONSE EXAMPLE
{
"result": true,
"data": {
"name": "gist",
"bare": true,
"path": "awesome_user/gist.git"
"filesize": 2035712
}
}
POST /repos/:repo_name/fork_bare
PARAMS
path: { type:String, required:true }
REQUEST EXAMPLE
POST /repos/awesome_user/gist/fork_bare
{
"path": {awesome_user2}
}
RESPONSE EXAMPLE
{
"result": true,
"data": {
"name": "gist",
"bare": true,
"path": "awesome_user2/gist.git"
"filesize": 2035712
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment