コード例 #1
0
ファイル: ApiClient.cs プロジェクト: ionelanton/ProxmoxSharp
 public IRestResponse<ApiTicket> Login(User user)
 {
     var restClient = new RestClient (_baseUrl);
     var request = new RestRequest("access/ticket", Method.POST) {RequestFormat = DataFormat.Json};
     request.AddParameter ("username", user.Username);
     request.AddParameter ("password", user.Password);
     request.AddParameter ("realm", user.Realm);
     request.RootElement = RequestRootElement;
     var response = restClient.Execute<ApiTicket>(request);
     _apiTicket = response.Data;
     return response;
 }
コード例 #2
0
ファイル: ApiClient.cs プロジェクト: wanman/ProxmoxSharp
        public IRestResponse <ApiTicket> Login(User user)
        {
            var restClient = new RestClient(_baseUrl);
            var request    = new RestRequest("access/ticket", Method.POST)
            {
                RequestFormat = DataFormat.Json
            };

            request.AddParameter("username", user.Username);
            request.AddParameter("password", user.Password);
            request.AddParameter("realm", user.Realm);
            request.RootElement = RequestRootElement;
            var response = restClient.Execute <ApiTicket>(request);

            _apiTicket = response.Data;
            return(response);
        }