SHARE
TWEET

Untitled

a guest Mar 20th, 2019 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public static void EnviarDatos<T>(string url, T data, EmpresaData empresa)
  2.     {
  3.         try
  4.         {
  5.             using (HttpClient client = new HttpClient())
  6.             {
  7.                 string json = JsonConvert.SerializeObject(data);
  8.  
  9.                 var stringContent = new StringContent(json, UnicodeEncoding.UTF8, "application/json");
  10.  
  11.                 var result = client.PostAsync(url + "?identificador=" + empresa.Identificador, stringContent).Result;
  12.  
  13.  
  14.             }
  15.         }
  16.         catch (Exception e)
  17.         {
  18.  
  19.         }
  20.  
  21.     }
  22.      
  23. [HttpPost]
  24.     public IHttpActionResult Turnos(List<Turnos> Turnos, string identificador)
  25.     { ...... }
  26.  
  27.  [HttpPost]
  28.         public IHttpActionResult Sectores(List<Sectores> Sectoress, string identificador)
  29.         { ..... }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top