A weather API
Http://wthrcdn.etouch.cn/WeatherApi?city=%E5%8C%97%E4%BA%AC
You can check the weather in Beijing. Behind the city= is the name of the city, which is Beijing.
The return format is Xml,gzip compression.
Get C # code for XML data
WebRequest request = WebRequest.Create ("Http://wthrcdn.etouch.cn/WeatherApi?city=%E5%8C%97%E4%BA%AC");
WebResponse response = Request. GetResponse ();
GZipStream gstream = new GZipStream (response. GetResponseStream (), compressionmode.decompress, true);
StreamReader reader = new StreamReader (Gstream, Encoding.UTF8);
String str = reader. ReadToEnd ();
Reader. Close ();
Response. Close ();
STR is the obtained XML format for weather information. Get data through subsequent XML parsing.
This weather API gives a more detailed message. A screenshot of the test procedure is attached.
The code is tested through visual Studio 2015.