Guest User

Untitled

a guest
Jun 25th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. HttpWebRequest handler = (HttpWebRequest)WebRequest.Create("someUrl");
  2. handler.Method = "POST";
  3.  
  4. string postData = "some data";
  5.  
  6. byte[] data = Encoding.ASCII.GetBytes(postData);
  7. handler.ContentLength = data.Length;
  8. using (var stream = handler.GetRequestStream())
  9. {
  10. stream.Write(data, 0, data.Length);
  11. }
  12. handler.ContentType = "application/xml; charset=utf-8";
  13. HttpWebResponse response = (HttpWebResponse)handler.GetResponse();
  14.  
  15. <security mode="Transport"/>
Add Comment
Please, Sign In to add comment