Advertisement
Guest User

Untitled

a guest
May 16th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. public static async Task<bool> SignIn(string userName, string password)
  2. {
  3. var user = new { UserName = userName, Password = password };
  4. // HttpResponseMessage response = await CallAPI(client => client.PostAsJsonAsync("api/account/SignIn", user));
  5. HttpResponseMessage response = await CallAPI(client => client.PostAsync("api/AgentCollection", new StringContent(new JavaScriptSerializer().Serialize(user), Encoding.UTF8, "application/json")));
  6.  
  7.  
  8. bool result = false;
  9. if (response.IsSuccessStatusCode)
  10. {
  11. result = await response.Content.read.ReadAsAsync<bool>();
  12. }
  13.  
  14. return result;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement