zoukankan      html  css  js  c++  java
  • c# HttpClient禁止缓存

    using (var client = new HttpClient())
                {

                   //方法1:

                    CacheControlHeaderValue cacheControl = new CacheControlHeaderValue();
                    cacheControl.NoCache = true;
                    cacheControl.NoStore = true;
                    client.DefaultRequestHeaders.CacheControl = cacheControl;

                   //方法2:

                    //client.DefaultRequestHeaders.Add("Cache-Control", "no-cache");
                    try
                    {
                        client.GetStringAsync(url);
                        return true;
                    }
                    catch
                    {
                        return false;
                    }
                }

  • 相关阅读:
    cs61b project1
    CS61b lab5
    leetcode DP
    Leetcode 还未解决的bug
    Git使用总结
    Mac TensorFlow Anaconda
    eclipse C++ ld: 1 duplicate symbol for architecture x86_64
    Leetcode Hashtable 1-5
    EC 601 PYTHONPATH
    EC 601 OpenCV Install
  • 原文地址:https://www.cnblogs.com/94cool/p/5949082.html
Copyright © 2011-2022 走看看