Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. var httpWebRequest = WebRequest.Create("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
  2. httpWebRequest.ContentType = "application/json";
  3. httpWebRequest.Method = "POST";
  4.  
  5. using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
  6. {
  7. string json = "{ 'nl': { 'NL': '" + numeroLogico + "', 'CPF_CNPJ': '" + cnpj.Trim() + "', 'Bandeiras': [" + bandeiras + "], 'InativarBandeira': '" + inativarBandeiras + "', 'InativarLogico': '" + inativarLogico + "' } }";
  8. string jsonFinal = json.Replace("'", """);
  9.  
  10. streamWriter.Write(json);
  11. streamWriter.Flush();
  12. streamWriter.Close();
  13. }
  14.  
  15. var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
  16.  
  17. ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement