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.
We honor the default global caching behavior. To change the default behavior use URLConnection.
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 for
NetHttpTransport.
|
| Constructor and Description |
|---|
NetHttpTransport()
Constructor with the default behavior.
|
| Modifier and Type | Method and Description |
|---|---|
protected com |
buildRequest(String
Builds a low level HTTP request for the given HTTP method.
|
boolean |
supportsMethod(String
Returns whether a specified HTTP method is supported by this transport.
|
createRequestFactory, createRequestFactory, shutdownpublic NetHttpTransport()
Instead use NetHttpTransport.Builder to modify behavior.
public boolean supportsMethod(Stringmethod)
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 method
protected com.api .client .http .javanet .NetHttpRequest buildRequest(String method, String url) throws IOException
HttpTransport
buildRequest in class
HttpTransport
method - HTTP method
url - URL
IOException