# Package com.google.api.client.http.apache.v5 (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.apache.v5)
- [2.0.3](https://docs.cloud.google.com/java/docs/reference/google-http-client/2.0.3/com.google.api.client.http.apache.v5)
- [1.47.1](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.47.1/com.google.api.client.http.apache.v5)
- [1.46.3](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.46.3/com.google.api.client.http.apache.v5)
- [1.45.3](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.45.3/com.google.api.client.http.apache.v5)
- [1.44.2](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.44.2/com.google.api.client.http.apache.v5)
- [1.43.2](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.43.2/com.google.api.client.http.apache.v5)
- [1.42.3](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.42.3/com.google.api.client.http.apache.v5)
- [1.41.8](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.41.8/com.google.api.client.http.apache.v5)
HTTP Transport library for Google API's based on Apache HTTP Client/Core version 5.x

## Classes

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

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

Thread-safe HTTP transport based on the Apache HTTP Client library.

Implementation is thread-safe, as long as any parameter modification to the [Apache HTTP Client](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.http.apache.v5.Apache5HttpTransport#com_google_api_client_http_apache_v5_Apache5HttpTransport_getHttpClient__) is only done at initialization time. For maximum efficiency,
applications should use a single globally-shared instance of the HTTP transport.

Default settings are specified in [#newDefaultHttpClient()](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.http.apache.v5.Apache5HttpTransport#com_google_api_client_http_apache_v5_Apache5HttpTransport_newDefaultHttpClient__). Use the [#Apache5HttpTransport(HttpClient)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.http.apache.v5.Apache5HttpTransport#com_google_api_client_http_apache_v5_Apache5HttpTransport_Apache5HttpTransport_org_apache_hc_client5_http_classic_HttpClient_) constructor to override the Apache HTTP Client used. Please
read the [Apache HTTP Client 5.x configuration example](https://github.com/apache/httpcomponents-client/blob/f898f1aca38f77f62a007856a674629cae5a02e6/httpclient5/src/test/java/org/apache/hc/client5/http/examples/ClientConfiguration.java) for more complex configuration options.

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

Class that wraps an org.apache.hc.core5.http.HttpEntity's content [InputStream](https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html)
along with the ClassicHttpResponse that contains this entity. The main purpose is to be
able to close the response as well as the content input stream when [#close()](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.http.apache.v5.Apache5ResponseContent#com_google_api_client_http_apache_v5_Apache5ResponseContent_close__) is called,
in order to not break the existing contract with clients using apache v4 that only required them
to close the input stream to clean up all resources.