[[["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,["# Class LowLevelHttpRequest (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.LowLevelHttpRequest)\n- [1.47.1](/java/docs/reference/google-http-client/1.47.1/com.google.api.client.http.LowLevelHttpRequest)\n- [1.46.3](/java/docs/reference/google-http-client/1.46.3/com.google.api.client.http.LowLevelHttpRequest)\n- [1.45.3](/java/docs/reference/google-http-client/1.45.3/com.google.api.client.http.LowLevelHttpRequest)\n- [1.44.2](/java/docs/reference/google-http-client/1.44.2/com.google.api.client.http.LowLevelHttpRequest)\n- [1.43.2](/java/docs/reference/google-http-client/1.43.2/com.google.api.client.http.LowLevelHttpRequest)\n- [1.42.3](/java/docs/reference/google-http-client/1.42.3/com.google.api.client.http.LowLevelHttpRequest)\n- [1.41.8](/java/docs/reference/google-http-client/1.41.8/com.google.api.client.http.LowLevelHttpRequest) \n\n public abstract class LowLevelHttpRequest\n\nLow-level HTTP request.\n\nThis allows providing a different implementation of the HTTP request that is more compatible\nwith the Java environment used.\n\nImplementation has no fields and therefore thread-safe, but sub-classes are not necessarily\nthread-safe. \n\nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e LowLevelHttpRequest \n\nInherited Members\n-----------------\n\n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nConstructors\n------------\n\n### LowLevelHttpRequest()\n\n public LowLevelHttpRequest()\n\nMethods\n-------\n\n### addHeader(String name, String value)\n\n public abstract void addHeader(String name, String value)\n\nAdds a header to the HTTP request.\n\nNote that multiple headers of the same name need to be supported, in which case [#addHeader](/java/docs/reference/google-http-client/latest/com.google.api.client.http.LowLevelHttpRequest#com_google_api_client_http_LowLevelHttpRequest_addHeader_) will be called for each instance of the header.\n\n### execute()\n\n public abstract LowLevelHttpResponse execute()\n\nExecutes the request and returns a low-level HTTP response object.\n\n### getContentEncoding()\n\n public final String getContentEncoding()\n\nReturns the content encoding (for example `\"gzip\"`) or `null` for none.\n\n### getContentLength()\n\n public final long getContentLength()\n\nReturns the content length or less than zero if not known.\n\n### getContentType()\n\n public final String getContentType()\n\nReturns the content type or `null` for none.\n\n### getStreamingContent()\n\n public final StreamingContent getStreamingContent()\n\nReturns the streaming content or `null` for no content.\n\n### setContentEncoding(String contentEncoding)\n\n public final void setContentEncoding(String contentEncoding)\n\nSets the content encoding (for example `\"gzip\"`) or `null` for none.\n\n### setContentLength(long contentLength)\n\n public final void setContentLength(long contentLength)\n\nSets the content length or less than zero if not known.\n\nDefault value is `-1`.\n\n### setContentType(String contentType)\n\n public final void setContentType(String contentType)\n\nSets the content type or `null` for none.\n\n### setStreamingContent(StreamingContent streamingContent)\n\n public final void setStreamingContent(StreamingContent streamingContent)\n\nSets the streaming content or `null` for no content.\n\n### setTimeout(int connectTimeout, int readTimeout)\n\n public void setTimeout(int connectTimeout, int readTimeout)\n\nSets the connection and read timeouts.\n\nDefault implementation does nothing, but subclasses should normally override.\n\n### setWriteTimeout(int writeTimeout)\n\n public void setWriteTimeout(int writeTimeout)\n\nSets the write timeout for POST/PUT requests.\n\nDefault implementation does nothing, but subclasses should normally override."]]