public final class NetHttpTransport extends HttpTransport
java.net package.
Users should consider modifying the keep alive property on NetHttpTransport to control
whether the socket should be returned to a pool of connected sockets. More information is
available here.
Implementation is thread-safe. For maximum efficiency, applications should use a single globally-shared instance of the HTTP transport.
| Modifier and Type | Class and Description |
|---|---|
static class |
NetHttpTransport.Builder
Builder for
NetHttpTransport. |
| Constructor and Description |
|---|
NetHttpTransport()
Constructor with the default behavior.
|
| Modifier and Type | Method and Description |
|---|---|
com.google.api.client.http.javanet.NetHttpRequest |
buildDeleteRequest(String url)
Deprecated.
|
com.google.api.client.http.javanet.NetHttpRequest |
buildGetRequest(String url)
Deprecated.
|
com.google.api.client.http.javanet.NetHttpRequest |
buildHeadRequest(String url)
Deprecated.
|
com.google.api.client.http.javanet.NetHttpRequest |
buildPostRequest(String url)
Deprecated.
|
com.google.api.client.http.javanet.NetHttpRequest |
buildPutRequest(String url)
Deprecated.
|
protected com.google.api.client.http.javanet.NetHttpRequest |
buildRequest(String method,
String url)
Builds a low level HTTP request for the given HTTP method.
|
boolean |
supportsHead()
Deprecated.
|
boolean |
supportsMethod(String method)
Returns whether a specified HTTP method is supported by this transport.
|
buildPatchRequest, createRequestFactory, createRequestFactory, shutdown, supportsPatchpublic NetHttpTransport()
Instead use NetHttpTransport.Builder to modify behavior.
public boolean supportsMethod(String method)
HttpTransport
Default implementation returns true if and only if the request method is "DELETE",
"GET", "POST", or "PUT". Subclasses should override.
supportsMethod in class HttpTransportmethod - HTTP methodprotected com.google.api.client.http.javanet.NetHttpRequest buildRequest(String method, String url) throws IOException
HttpTransport
Warning: for backwards compatibility, in version 1.12 a default implementation that throws an
IllegalArgumentException is provided, but it will be made abstract in the next version
1.13.
buildRequest in class HttpTransportmethod - HTTP methodurl - URLIOException - I/O exception@Deprecated public boolean supportsHead()
HttpTransportHEAD request method.
Default implementation calls HttpTransport.supportsMethod(java.lang.String).
Upgrade warning: this method now throws an IOException. In prior version 1.11 it did
not throw an exception.
supportsHead in class HttpTransport@Deprecated public com.google.api.client.http.javanet.NetHttpRequest buildDeleteRequest(String url) throws IOException
HttpTransportDELETE request.
Default implementation calls HttpTransport.buildRequest().
buildDeleteRequest in class HttpTransporturl - URLIOException@Deprecated public com.google.api.client.http.javanet.NetHttpRequest buildGetRequest(String url) throws IOException
HttpTransportGET request.
Default implementation calls HttpTransport.buildRequest().
buildGetRequest in class HttpTransporturl - URLIOException@Deprecated public com.google.api.client.http.javanet.NetHttpRequest buildHeadRequest(String url) throws IOException
HttpTransportHEAD request.
Won't be called if HttpTransport.supportsHead() returns false.
Default implementation calls HttpTransport.buildRequest().
Upgrade warning: in prior version it threw an UnsupportedOperationException by
default}.
buildHeadRequest in class HttpTransporturl - URLIOException@Deprecated public com.google.api.client.http.javanet.NetHttpRequest buildPostRequest(String url) throws IOException
HttpTransportPOST request.
Default implementation calls HttpTransport.buildRequest().
buildPostRequest in class HttpTransporturl - URLIOException@Deprecated public com.google.api.client.http.javanet.NetHttpRequest buildPutRequest(String url) throws IOException
HttpTransportPUT request.
Default implementation calls HttpTransport.buildRequest().
buildPutRequest in class HttpTransporturl - URLIOExceptionCopyright © 2011-2012 Google. All Rights Reserved.