static void GetSecureContent(SecureApiClient client) { var url = string.Concat("http://apisec.pocs.localhost/api/test/", HttpUtility.UrlEncode("My_Friend")); var response = client.DownloadSecureData(url); Console.WriteLine(Encoding.UTF8.GetString(response)); }
static void PostSecureContent(SecureApiClient client) { var url = "http://apisec.pocs.localhost/api/test"; var response = client.UploadSecureData(url, new { FirstName = "Carlos", LastName = "Salvatore" }); Console.WriteLine(Encoding.UTF8.GetString(response)); }
static void Main(string[] args) { // CreateLogin(); var client = new SecureApiClient(APPId, APIKey); client.Authenticate("http://apisec.pocs.localhost/Token", _email, _password); GetSecureContent(client); PostSecureContent(client); Console.ReadLine(); }
static void CreateLogin() { var client = new SecureApiClient(APPId, APIKey); client.CreateLogin("http://apisec.pocs.localhost/api/Account/Register", _email, _password); }