How do you disable caching with WebClient and Windows Phone 7

后端 未结 4 2038
攒了一身酷
攒了一身酷 2020-12-20 17:02

I am making a call to a REST web service and the mobile app is retrieving the results from its cache and not going to the server.

I have seen other suggested fixes (

4条回答
  •  爱一瞬间的悲伤
    2020-12-20 17:32

    WebClient wc = new WebClient();
    wc.Headers[HttpRequestHeader.IfModifiedSince] = DateTime.UtcNow.ToString();
    

    worked for me

提交回复
热议问题