public final class UrlFetchTransport extends HttpTransport
Implementation is thread-safe. For maximum efficiency, applications should use a single globally-shared instance of the HTTP transport.
URL Fetch is only available on Google App Engine (not on any other Java environment), and is the
underlying HTTP transport used for App Engine. Their implementation of HttpURLConnection
is simply an abstraction layer on top of URL Fetch. By implementing a transport that directly
uses URL Fetch, we can optimize the behavior slightly, and can potentially take advantage of
features in URL Fetch that are not available in HttpURLConnection. Furthermore, there is
currently a serious bug in how HTTP headers are processed in the App Engine implementation of
HttpURLConnection, which we are able to avoid using this implementation. Therefore, this
is the recommended transport to use on App Engine.
| Modifier and Type | Class and Description |
|---|---|
static class |
UrlFetchTransport.Builder
Builder for
UrlFetchTransport. |
| Constructor and Description |
|---|
UrlFetchTransport()
Constructor with the default fetch options.
|
| Modifier and Type | Method and Description |
|---|---|
protected com.google.api.client.extensions.appengine.http.UrlFetchRequest |
buildRequest(String method,
String url) |
static UrlFetchTransport |
getDefaultInstance()
Returns a global thread-safe instance.
|
boolean |
supportsMethod(String method) |
createRequestFactory, createRequestFactory, shutdownpublic UrlFetchTransport()
Use UrlFetchTransport.Builder to modify fetch options.
public static UrlFetchTransport getDefaultInstance()
public boolean supportsMethod(String method)
supportsMethod in class HttpTransportprotected com.google.api.client.extensions.appengine.http.UrlFetchRequest buildRequest(String method, String url) throws IOException
buildRequest in class HttpTransportIOExceptionCopyright © 2011-2015 Google. All Rights Reserved.