1
我正在嘗試使用RestSharp創建一個youtrack客戶端。我可以登錄,但是當我嘗試獲得項目時,我收到以下響應:Youtrack和RestSharp權限問題
{「value」:「您沒有權限讀取項目,您以****身份登錄」}
然而,當我登錄到YouTrack在我的瀏覽器,我可以訪問該項目,並進行更改,等等。附件是我的代碼(我用RestSharp):
var client = new RestClient(Site);
var request = new RestRequest(String.Format("rest/user/login?login={0}&password={1}", Username, Password), Method.POST);
//reuse the client
client.CookieContainer = new System.Net.CookieContainer();
IRestResponse response = client.Execute(request);
var content = response.Content;
//returns <login>ok</login> - so it's logging in
Console.WriteLine("LOGIN \n" + content);
String projectId = "PW";
request = new RestRequest(String.Format("rest/admin/project/projectId={0}", projectId), Method.GET);
response = client.Execute(request);
content = response.Content;
Console.WriteLine("Get Project: \n\n" + content);
有什麼代碼我丟了?或者這是一個YouTrack設置問題,我需要與我的管理員?