I'm working on a Silverlight app which among other things makes Http requests in which it uploads a zip file from the web server. The zip file is picked up from the web server every n:th minute, a behavior controlled by a timer.
I've tried using the WebClient
and HttpWebRequest
classes with the same result. The request only reaches the web server the first time. The second, third, ..., time the request is sent and a response will occur. However, the request never reaches the web server...
void _timer_Tick(object sender, EventArgs e)
{
try
{
HttpWebRequest req = WebRequest.CreateHttp(_serverUrl + "channel.zip");
req.Method = "GET";
req.BeginGetResponse(new AsyncCallback(WebComplete), req);
}
catch (Exception ex)
{
throw ex;
}
}
void WebComplete(IAsyncResult a)
{
HttpWebRequest req = (HttpWebRequest)a.AsyncState;
HttpWebResponse res = (HttpWebResponse)req.EndGetResponse(a);
Stream stream = res.GetResponseStream();
byte[] content = readFully(stream);
unzip(content);
}
Is there some kind of browser caching issue here? I want every request I make to go all the way to the web server.