Package com.dropbox.core.http
Class HttpRequestor
java.lang.Object
com.dropbox.core.http.HttpRequestor
- Direct Known Subclasses:
GoogleAppEngineRequestor,OkHttp3Requestor,OkHttpRequestor,StandardHttpRequestor
An interface that the Dropbox client library uses to make HTTP requests.
If you're fine with the standard Java
HttpURLConnection
implementation, then just use StandardHttpRequestor.INSTANCE.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA simple structure holding an HTTP header, which is key/value pair.static final classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longDefault timeout, in milliseconds, for opening a connection to a network resource.static final longDefault timeout, in milliseconds, for receiving a response from a network resource. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract HttpRequestor.ResponsedoGet(String url, Iterable<HttpRequestor.Header> headers) abstract HttpRequestor.UploaderstartPost(String url, Iterable<HttpRequestor.Header> headers) startPostInStreamingMode(String url, Iterable<HttpRequestor.Header> headers) abstract HttpRequestor.UploaderstartPut(String url, Iterable<HttpRequestor.Header> headers)
-
Field Details
-
DEFAULT_CONNECT_TIMEOUT_MILLIS
public static final long DEFAULT_CONNECT_TIMEOUT_MILLISDefault timeout, in milliseconds, for opening a connection to a network resource. A value of 0 indicates the timeout should be disabled. -
DEFAULT_READ_TIMEOUT_MILLIS
public static final long DEFAULT_READ_TIMEOUT_MILLISDefault timeout, in milliseconds, for receiving a response from a network resource. A value of 0 indicates the timeout should be disabled.
-
-
Constructor Details
-
HttpRequestor
public HttpRequestor()
-
-
Method Details
-
doGet
public abstract HttpRequestor.Response doGet(String url, Iterable<HttpRequestor.Header> headers) throws IOException - Throws:
IOException
-
startPost
public abstract HttpRequestor.Uploader startPost(String url, Iterable<HttpRequestor.Header> headers) throws IOException - Throws:
IOException
-
startPostInStreamingMode
public HttpRequestor.Uploader startPostInStreamingMode(String url, Iterable<HttpRequestor.Header> headers) throws IOException - Throws:
IOException
-
startPut
public abstract HttpRequestor.Uploader startPut(String url, Iterable<HttpRequestor.Header> headers) throws IOException - Throws:
IOException
-