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 is only done at initialization time. For maximum efficiency,
applications should use a single globally-shared instance of the HTTP transport.
Class that wraps an org.apache.hc.core5.http.HttpEntity's content InputStream
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() 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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Package com.google.api.client.http.apache.v5 (2.0.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.0.0 (latest)](/java/docs/reference/google-http-client/latest/com.google.api.client.http.apache.v5)\n- [1.47.1](/java/docs/reference/google-http-client/1.47.1/com.google.api.client.http.apache.v5)\n- [1.46.3](/java/docs/reference/google-http-client/1.46.3/com.google.api.client.http.apache.v5)\n- [1.45.3](/java/docs/reference/google-http-client/1.45.3/com.google.api.client.http.apache.v5)\n- [1.44.2](/java/docs/reference/google-http-client/1.44.2/com.google.api.client.http.apache.v5)\n- [1.43.2](/java/docs/reference/google-http-client/1.43.2/com.google.api.client.http.apache.v5)\n- [1.42.3](/java/docs/reference/google-http-client/1.42.3/com.google.api.client.http.apache.v5)\n- [1.41.8](/java/docs/reference/google-http-client/1.41.8/com.google.api.client.http.apache.v5) \nHTTP Transport library for Google API's based on Apache HTTP Client/Core version 5.x\n\nClasses\n-------\n\n### [Apache5HttpRequest](/java/docs/reference/google-http-client/latest/com.google.api.client.http.apache.v5.Apache5HttpRequest)\n\n### [Apache5HttpTransport](/java/docs/reference/google-http-client/latest/com.google.api.client.http.apache.v5.Apache5HttpTransport)\n\nThread-safe HTTP transport based on the Apache HTTP Client library.\n\nImplementation is thread-safe, as long as any parameter modification to the [Apache HTTP Client](/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,\napplications should use a single globally-shared instance of the HTTP transport.\n\nDefault settings are specified in [#newDefaultHttpClient()](/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)](/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\nread 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.\n\n### [Apache5ResponseContent](/java/docs/reference/google-http-client/latest/com.google.api.client.http.apache.v5.Apache5ResponseContent)\n\nClass that wraps an org.apache.hc.core5.http.HttpEntity's content [InputStream](https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html)\nalong with the ClassicHttpResponse that contains this entity. The main purpose is to be\nable to close the response as well as the content input stream when [#close()](/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,\nin order to not break the existing contract with clients using apache v4 that only required them\nto close the input stream to clean up all resources."]]