天气预报接口

using System.Net;
using System.Collections.Specialized;

WebClient webClient = new WebClient();
string url = "http://www.webxml.com.cn/WebServices/WeatherWebService.asmx/getWeatherbyCityName";
NameValueCollection postValues = new NameValueCollection();
postValues.Add("theCityName", "北京");
byte[] responseArray = webClient.UploadValues(url, postValues);
string data = Encoding.UTF8.GetString(responseArray);
MessageBox.Show(data);


截图如下:




http://www.webxml.com.cn/WebServices/WeatherWebService.asmx

http://blog.csdn.net/a535537066/article/details/6656365

HTTP POST:http://www.cnblogs.com/kill-signal/archive/2012/08/09/2631076.html

                       http://blog.csdn.net/cat9101983/article/details/6427347

                       http://tech.it168.com/d/2008-07-04/200807040905410.shtml

你可能感兴趣的:(天气预报接口)