# Package com.google.api.client.http.javanet (2.1.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.1.0 (latest)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.http.javanet)
- [2.0.3](https://docs.cloud.google.com/java/docs/reference/google-http-client/2.0.3/com.google.api.client.http.javanet)
- [1.47.1](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.47.1/com.google.api.client.http.javanet)
- [1.46.3](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.46.3/com.google.api.client.http.javanet)
- [1.45.3](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.45.3/com.google.api.client.http.javanet)
- [1.44.2](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.44.2/com.google.api.client.http.javanet)
- [1.43.2](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.43.2/com.google.api.client.http.javanet)
- [1.42.3](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.42.3/com.google.api.client.http.javanet)
- [1.41.8](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.41.8/com.google.api.client.http.javanet)
HTTP Transport library for Google API's based on the `java.net` package.

## Classes

### [DefaultConnectionFactory](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.http.javanet.DefaultConnectionFactory)

Default implementation of [ConnectionFactory](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.http.javanet.ConnectionFactory), which simply attempts to open the connection
with an optional [Proxy](https://docs.oracle.com/javase/8/docs/api/java/net/Proxy.html).

### [NetHttpTransport](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.http.javanet.NetHttpTransport)

Thread-safe HTTP low-level transport based on the `java.net` package.

Users should consider modifying the keep alive property on [NetHttpTransport](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.http.javanet.NetHttpTransport) to control
whether the socket should be returned to a pool of connected sockets. More information is
available [here](http://docs.oracle.com/javase/7/docs/technotes/guides/net/http-keepalive.html).

We honor the default global caching behavior. To change the default behavior use HttpURLConnection#setDefaultUseCaches(boolean).

Implementation is thread-safe. For maximum efficiency, applications should use a single
globally-shared instance of the HTTP transport.

### [NetHttpTransport.Builder](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.http.javanet.NetHttpTransport.Builder)

Builder for [NetHttpTransport](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.http.javanet.NetHttpTransport).

Implementation is not thread-safe.

## Interfaces

### [ConnectionFactory](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.http.javanet.ConnectionFactory)

Given a [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html) instance, produces an [HttpURLConnection](https://docs.oracle.com/javase/8/docs/api/java/net/HttpURLConnection.html).