Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cancel an async webrequest?

I am using the Async CTP library for Windows Phone. Does anyone know how to cancel a pending webrequest?

Request = (HttpWebRequest)WebRequest.Create(url);
Request.Credentials = new NetworkCredential(_settings.Username, _settings.Password);
WebResponse resp;
try
{
    resp = await Request.GetResponseAsync();
}

There is no cancellation token (as specified in the ASYNC Ctp tap document).

like image 908
markwilde Avatar asked Dec 26 '11 12:12

markwilde


1 Answers

You could try calling Request.Abort().

like image 137
Stephen Cleary Avatar answered Sep 23 '22 18:09

Stephen Cleary