Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var request = (HttpWebRequest)WebRequest.Create("http://www.example.com/recepticle.aspx");
- var postData = "thing1=hello";
- postData += "&thing2=world";
- var data = Encoding.ASCII.GetBytes(postData);
- request.Method = "POST";
- request.ContentType = "application/x-www-form-urlencoded";
- request.ContentLength = data.Length;
- using (var stream = request.GetRequestStream())
- {
- stream.Write(data, 0, data.Length);
- }
- var response = (HttpWebResponse)request.GetResponse();
- var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement