操作
使用.NET的REST API¶
Redmine .NET API库是一个免费的三方C#库,可用于访问Redmine API。它遵循Apache 2开源许可证。
要从PowerShell使用此库,请参阅使用PowerShell的REST API
示例用法
using System;
using System.Collections.Specialized;
using Redmine.Net.Api;
using Redmine.Net.Api.Types;
namespace RedmineTest
{
class Program
{
static void Main(string[] args)
{
string host = "";
string apiKey = "";
var manager = new RedmineManager(host, apiKey);
var parameters = new NameValueCollection {{"status_id", "*"}};
foreach (var issue in manager.GetObjects<Issue>(parameters))
{
Console.WriteLine("#{0}: {1}", issue.Id, issue.Subject);
}
//Create a issue.
var newIssue = new Issue { Subject = "test", Project = new IdentifiableName{Id = 1}};
manager.CreateObject(newIssue);
}
}
}
由Seung Soo Mun更新 超过2年前 · 4次修订