public class GoogleAppEngineRequestor extends HttpRequestor
HttpRequestor
implementation that uses Google App Engine URL fetch service.
You can only use this if your project includes the App Engine libraries.
If your app runs in Google App Engine, it is strongly recommended to use this Requestor to ensure certificate validation is performed on all requests.
To use this, pass an instance to the DbxRequestConfig
constructor:
DbxRequestConfig config = DbxRequestConfig.newBuilder("MyAppEngineApp/1.0") .withHttpRequestor(new GoogleAppEngineRequestor()) .build(); String accessToken = ...; DbxClientV2 client = new DbxClientV2(config, accessToken);
HttpRequestor.Header, HttpRequestor.Response, HttpRequestor.Uploader
DEFAULT_CONNECT_TIMEOUT_MILLIS, DEFAULT_READ_TIMEOUT_MILLIS
Constructor and Description |
---|
GoogleAppEngineRequestor() |
GoogleAppEngineRequestor(com.google.appengine.api.urlfetch.FetchOptions options) |
GoogleAppEngineRequestor(com.google.appengine.api.urlfetch.FetchOptions options,
com.google.appengine.api.urlfetch.URLFetchService service) |
Modifier and Type | Method and Description |
---|---|
HttpRequestor.Response |
doGet(java.lang.String url,
java.lang.Iterable<HttpRequestor.Header> headers) |
com.google.appengine.api.urlfetch.FetchOptions |
getOptions() |
com.google.appengine.api.urlfetch.URLFetchService |
getService() |
static com.google.appengine.api.urlfetch.FetchOptions |
newDefaultOptions()
Returns a new instance of the default
FetchOptions used by this requestor. |
HttpRequestor.Uploader |
startPost(java.lang.String url,
java.lang.Iterable<HttpRequestor.Header> headers) |
HttpRequestor.Uploader |
startPut(java.lang.String url,
java.lang.Iterable<HttpRequestor.Header> headers) |
startPostInStreamingMode
public GoogleAppEngineRequestor()
public GoogleAppEngineRequestor(com.google.appengine.api.urlfetch.FetchOptions options)
public GoogleAppEngineRequestor(com.google.appengine.api.urlfetch.FetchOptions options, com.google.appengine.api.urlfetch.URLFetchService service)
public com.google.appengine.api.urlfetch.FetchOptions getOptions()
public com.google.appengine.api.urlfetch.URLFetchService getService()
public HttpRequestor.Response doGet(java.lang.String url, java.lang.Iterable<HttpRequestor.Header> headers) throws java.io.IOException
doGet
in class HttpRequestor
java.io.IOException
public HttpRequestor.Uploader startPost(java.lang.String url, java.lang.Iterable<HttpRequestor.Header> headers) throws java.io.IOException
startPost
in class HttpRequestor
java.io.IOException
public HttpRequestor.Uploader startPut(java.lang.String url, java.lang.Iterable<HttpRequestor.Header> headers) throws java.io.IOException
startPut
in class HttpRequestor
java.io.IOException
public static com.google.appengine.api.urlfetch.FetchOptions newDefaultOptions()
FetchOptions
used by this requestor. This
method exists primarily since FetchOptions
provides no copy methods.