Guest User

Untitled

a guest
Feb 21st, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. byte[] requestBytes = System.Text.Encoding.ASCII.GetBytes(xml);
  2. req.Method = "POST";
  3. req.ContentType = "text/xml; encoding='utf-8'";
  4. req.ContentLength = requestBytes.Length;
  5. Stream requestStream = req.GetRequestStream();
  6. requestStream.Write(requestBytes, 0, requestBytes.Length);
  7. requestStream.Close();
  8.  
  9. **HttpWebResponse res = (HttpWebResponse)req.GetResponse();**
  10.  
  11. StreamReader sr = new StreamReader(res.GetResponseStream(), System.Text.Encoding.Default);
  12. string backstr = sr.ReadToEnd();
  13.  
  14. sr.Close();
  15. res.Close();
Add Comment
Please, Sign In to add comment