public class RequestDTO{ public string Username { get ; set ; } public string Password { get ; set ; }}public class ResponseDTO{ public bool IsOK { get ; set ; }}public void OnLoginClick (...){ var wc = new System.Net.WebClient() ; var req = new RequestDTO() { Username = "admin", Password = "123" } ; string json = Newtonsoft.Json.JsonConvert.SerializeObject(req) ; json = wc.UploadString("http://site.com/api/login", "POST", json) ; var res = Newtonsoft.Json.JsonConvert.DeserializeObject<ResponseDTO>(json) ; if (res.IsOK) { //... }}