public static Credentials Login(Credentials credentials)
{
var client = new RestClient();
var request = new RestRequest();
request.Method = Method.POST;
var json = JsonConvert.SerializeObject(credentials);
request.AddParameter("application/json; charset=utf-8", json, ParameterType.RequestBody);
request.Resource = ServiceBase+string.Format(Data.Service.Login);
RestResponse<Credentials> response = (RestResponse<Credentials>)client.Execute<Credentials>(request);
Credentials item = new Credentials();
JsonConvert.PopulateObject(response.Content,item);
return item;
}
Pretty simple, yes? -smiles-
No comments:
Post a Comment