Spring for Android

org.springframework.http.client
Class OkHttpClientHttpRequestFactory

java.lang.Object
  extended by org.springframework.http.client.SimpleClientHttpRequestFactory
      extended by org.springframework.http.client.OkHttpClientHttpRequestFactory
All Implemented Interfaces:
ClientHttpRequestFactory

public class OkHttpClientHttpRequestFactory
extends SimpleClientHttpRequestFactory

ClientHttpRequestFactory implementation that uses OkHttp to create requests.

Since:
2.0
Author:
Stéphane Nicolas
See Also:
OkHttpClient

Constructor Summary
OkHttpClientHttpRequestFactory()
           
 
Method Summary
protected  java.net.HttpURLConnection openConnection(java.net.URL url, java.net.Proxy proxy)
          Opens and returns a connection to the given URL.
 
Methods inherited from class org.springframework.http.client.SimpleClientHttpRequestFactory
createRequest, prepareConnection, setBufferRequestBody, setChunkSize, setConnectTimeout, setOutputStreaming, setProxy, setReadTimeout, setReuseConnection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OkHttpClientHttpRequestFactory

public OkHttpClientHttpRequestFactory()
Method Detail

openConnection

protected java.net.HttpURLConnection openConnection(java.net.URL url,
                                                    java.net.Proxy proxy)
                                             throws java.io.IOException
Description copied from class: SimpleClientHttpRequestFactory
Opens and returns a connection to the given URL.

The default implementation uses the given proxy - if any - to open a connection.

Overrides:
openConnection in class SimpleClientHttpRequestFactory
Parameters:
url - the URL to open a connection to
proxy - the proxy to use, may be null
Returns:
the opened connection
Throws:
java.io.IOException - in case of I/O errors

Spring for Android