com.google.api.client.extensions.appengine.http.urlfetch
Class UrlFetchTransport

java.lang.Object
  extended by com.google.api.client.http.HttpTransport
      extended by com.google.api.client.extensions.appengine.http.urlfetch.UrlFetchTransport

public final class UrlFetchTransport
extends HttpTransport

Thread-safe HTTP transport for Google App Engine based on URL Fetch.

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.

Since:
1.2
Author:
Yaniv Inbar

Constructor Summary
UrlFetchTransport()
           
 
Method Summary
 LowLevelHttpRequest buildDeleteRequest(String url)
           
 LowLevelHttpRequest buildGetRequest(String url)
           
 LowLevelHttpRequest buildHeadRequest(String url)
           
 LowLevelHttpRequest buildPostRequest(String url)
           
 LowLevelHttpRequest buildPutRequest(String url)
           
 boolean supportsHead()
           
 
Methods inherited from class com.google.api.client.http.HttpTransport
buildPatchRequest, createRequestFactory, createRequestFactory, shutdown, supportsPatch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UrlFetchTransport

public UrlFetchTransport()
Method Detail

supportsHead

public boolean supportsHead()
Overrides:
supportsHead in class HttpTransport

buildDeleteRequest

public LowLevelHttpRequest buildDeleteRequest(String url)
                                       throws IOException
Specified by:
buildDeleteRequest in class HttpTransport
Throws:
IOException

buildGetRequest

public LowLevelHttpRequest buildGetRequest(String url)
                                    throws IOException
Specified by:
buildGetRequest in class HttpTransport
Throws:
IOException

buildHeadRequest

public LowLevelHttpRequest buildHeadRequest(String url)
                                     throws IOException
Overrides:
buildHeadRequest in class HttpTransport
Throws:
IOException

buildPostRequest

public LowLevelHttpRequest buildPostRequest(String url)
                                     throws IOException
Specified by:
buildPostRequest in class HttpTransport
Throws:
IOException

buildPutRequest

public LowLevelHttpRequest buildPutRequest(String url)
                                    throws IOException
Specified by:
buildPutRequest in class HttpTransport
Throws:
IOException


Copyright © 2011 Google. All Rights Reserved.