2010-09-10 40 views

回答

0

使用RESTClient實現,首先你需要創建一個資源,然後用它來發布定義回購元JSON數據:

my_resource = RestClient::Resource.new("https://api.github.com", :user => "username", :password => "123456") 
my_resource["/user/repos"].post({ :name => "new-repo", :description => "this is a new repo", :public => true }.to_json) 

http://developer.github.com/v3/repos/有關API的詳細信息