Class OkHttpUtils


public class OkHttpUtils extends Object
  • Method Details

    • getClientWithProxyAndCache

      public static okhttp3.OkHttpClient getClientWithProxyAndCache(String httpEndpoint)
      Builds a OkHTTP client that respects any proxy set in the Jenkins 'Plugin Manager' and offers a response cache. A proxy will only be applied if the host of the httpEndpoint is NOT part of the noProxy values. The response cache is only present if the creation on disk is possible, otherwise there is none
      httpEndpoint - the host of the endpoint will get looked up against the noProxy values
      OkHttpClient setup with an appropriate httpProxy value and response cache
    • getCacheControl

      public static okhttp3.CacheControl getCacheControl(Integer minutesCached)