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
|Modifier and Type||Class and Description|
|Constructor and Description|
Constructor with the default fetch options.
|Modifier and Type||Method and Description|
Builds a low level HTTP request for the given HTTP method.
Returns a global thread-safe instance.
Returns whether a specified HTTP method is supported by this transport.
createRequestFactory, createRequestFactory, isMtls, shutdown
UrlFetchTransport.Builder to modify fetch options.
public static UrlFetchTransport getDefaultInstance()
public boolean supportsMethod(String method)
Default implementation returns true if and only if the request method is
"PUT". Subclasses should override.
protected com.google.api.client.extensions.appengine.http.UrlFetchRequest buildRequest(String method, String url) throws IOException
Copyright © 2011–2021 Google. All rights reserved.