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, supportsPatch
public 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 HttpTransport
method
- 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 HttpTransport
method
- HTTP methodurl
- URLIOException
- I/O exception@Deprecated public boolean supportsHead()
HttpTransport
HEAD
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
HttpTransport
DELETE
request.
Default implementation calls HttpTransport.buildRequest()
.
buildDeleteRequest
in class HttpTransport
url
- URLIOException
@Deprecated public com.google.api.client.http.javanet.NetHttpRequest buildGetRequest(String url) throws IOException
HttpTransport
GET
request.
Default implementation calls HttpTransport.buildRequest()
.
buildGetRequest
in class HttpTransport
url
- URLIOException
@Deprecated public com.google.api.client.http.javanet.NetHttpRequest buildHeadRequest(String url) throws IOException
HttpTransport
HEAD
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 HttpTransport
url
- URLIOException
@Deprecated public com.google.api.client.http.javanet.NetHttpRequest buildPostRequest(String url) throws IOException
HttpTransport
POST
request.
Default implementation calls HttpTransport.buildRequest()
.
buildPostRequest
in class HttpTransport
url
- URLIOException
@Deprecated public com.google.api.client.http.javanet.NetHttpRequest buildPutRequest(String url) throws IOException
HttpTransport
PUT
request.
Default implementation calls HttpTransport.buildRequest()
.
buildPutRequest
in class HttpTransport
url
- URLIOException
Copyright © 2011-2012 Google. All Rights Reserved.