HttpWebRequest 第一次请求 返回的都是正确的 但是后面的请求都是第一的
本帖最后由 auspi12341 于 2013-10-05 22:44:11 编辑
private void HandleResponse(IAsyncResult asyncResult)
{
HttpWebRequest httpRequest = null;
HttpWebResponse httpResponse = null;
httpRequest = (HttpWebRequest)asyncResult.AsyncState;
httpResponse = (HttpWebResponse)httpRequest.EndGetResponse(asyncResult);
Stream streamResult = httpResponse.GetResponseStream();
System.IO.StreamReader reader = new System.IO.StreamReader(streamResult, Encoding.UTF8);
Deployment.Current.Dispatcher.BeginInvoke(() =>{Result = reader.ReadToEnd();});
}
// Create the request.
WebRequest request = WebRequest.Create(uri);
// Define a cache policy for this request only.
HttpRequestCachePolicy noCachePolicy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore);
request.CachePolicy = noCachePolicy;