HttpWebRequest and HttpWebResponse in C#
问题 How to use HttpWebRequest and HttpWebResponse to create a webservice and how will the request and responses will be send across the wire? 回答1: this is the syntax for using HttpWebRequest and HttpWebResponse WebRequest _request; string text; string url = "UrlToGet"; _request = (HttpWebRequest)WebRequest.Create(url); using (WebResponse response = _request.GetResponse()) { using (StreamReader reader =new StreamReader(response.GetResponseStream())) { text = reader.ReadToEnd(); } } 回答2: