Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  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. { ..... }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement