org.springframework.http.client

Class OkHttp3ClientHttpRequestFactory

  • java.lang.Object
    • org.springframework.http.client.OkHttp3ClientHttpRequestFactory
    • Constructor Detail

      • OkHttp3ClientHttpRequestFactory

        public OkHttp3ClientHttpRequestFactory()
        Create a factory with a default OkHttpClient instance.
      • OkHttp3ClientHttpRequestFactory

        public OkHttp3ClientHttpRequestFactory(okhttp3.OkHttpClient client)
        Create a factory with the given OkHttpClient instance.
        Parameters:
        client - the client to use
    • Method Detail

      • setReadTimeout

        public void setReadTimeout(int readTimeout)
        Set the underlying read timeout in milliseconds. A value of 0 specifies an infinite timeout.
      • setWriteTimeout

        public void setWriteTimeout(int writeTimeout)
        Set the underlying write timeout in milliseconds. A value of 0 specifies an infinite timeout.
      • setConnectTimeout

        public void setConnectTimeout(int connectTimeout)
        Set the underlying connect timeout in milliseconds. A value of 0 specifies an infinite timeout.
      • destroy

        public void destroy()
                     throws java.io.IOException
        Description copied from interface: DisposableBean
        Invoked by the containing BeanFactory on destruction of a bean.
        Specified by:
        destroy in interface DisposableBean
        Throws:
        java.io.IOException