Skip to content

Instantly share code, notes, and snippets.

@simsicon

simsicon/api

Created Oct 22, 2013
Embed
What would you like to do?
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
You can’t perform that action at this time.