Package com.dropbox.core.http
Class HttpRequestor
- java.lang.Object
-
- com.dropbox.core.http.HttpRequestor
-
- Direct Known Subclasses:
GoogleAppEngineRequestor
,OkHttp3Requestor
,OkHttpRequestor
,StandardHttpRequestor
public abstract class HttpRequestor extends java.lang.Object
An interface that the Dropbox client library uses to make HTTP requests. If you're fine with the standard JavaHttpURLConnection
implementation, then just useStandardHttpRequestor.INSTANCE
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HttpRequestor.Header
A simple structure holding an HTTP header, which is key/value pair.static class
HttpRequestor.Response
static class
HttpRequestor.Uploader
-
Field Summary
Fields Modifier and Type Field Description static long
DEFAULT_CONNECT_TIMEOUT_MILLIS
Default timeout, in milliseconds, for opening a connection to a network resource.static long
DEFAULT_READ_TIMEOUT_MILLIS
Default timeout, in milliseconds, for receiving a response from a network resource.
-
Constructor Summary
Constructors Constructor Description HttpRequestor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract HttpRequestor.Response
doGet(java.lang.String url, java.lang.Iterable<HttpRequestor.Header> headers)
abstract HttpRequestor.Uploader
startPost(java.lang.String url, java.lang.Iterable<HttpRequestor.Header> headers)
HttpRequestor.Uploader
startPostInStreamingMode(java.lang.String url, java.lang.Iterable<HttpRequestor.Header> headers)
abstract HttpRequestor.Uploader
startPut(java.lang.String url, java.lang.Iterable<HttpRequestor.Header> headers)
-
-
-
Field Detail
-
DEFAULT_CONNECT_TIMEOUT_MILLIS
public static final long DEFAULT_CONNECT_TIMEOUT_MILLIS
Default 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_MILLIS
Default timeout, in milliseconds, for receiving a response from a network resource. A value of 0 indicates the timeout should be disabled.
-
-
Method Detail
-
doGet
public abstract HttpRequestor.Response doGet(java.lang.String url, java.lang.Iterable<HttpRequestor.Header> headers) throws java.io.IOException
- Throws:
java.io.IOException
-
startPost
public abstract HttpRequestor.Uploader startPost(java.lang.String url, java.lang.Iterable<HttpRequestor.Header> headers) throws java.io.IOException
- Throws:
java.io.IOException
-
startPostInStreamingMode
public HttpRequestor.Uploader startPostInStreamingMode(java.lang.String url, java.lang.Iterable<HttpRequestor.Header> headers) throws java.io.IOException
- Throws:
java.io.IOException
-
startPut
public abstract HttpRequestor.Uploader startPut(java.lang.String url, java.lang.Iterable<HttpRequestor.Header> headers) throws java.io.IOException
- Throws:
java.io.IOException
-
-