Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var request = (HttpWebRequest)WebRequest.Create("www.xyz.com");
- request.Method = "POST";
- request.ContentType = "application/x-www-form-urlencoded";
- request.KeepAlive = false;
- request.Headers.Add("Authorization", "Handshake");
- byte[] bodyData;
- bodyData = Encoding.UTF8.GetBytes(input_data);
- request.ContentLength = bodyData.Length;
- request.GetRequestStream().Write(bodyData, 0, bodyData.Length);
- request.GetRequestStream().Flush();
- request.GetRequestStream().Close();
- using (var response = request.GetResponse())
- {
- using (var reader = new StreamReader(response.GetResponseStream(), Encoding.UTF8))
- {
- string output_data = reader.ReadToEnd();
- }
- response.Close();
- }
Add Comment
Please, Sign In to add comment