Returns the final URL the content came from if redirects were followed
automatically in the request, if different than the input URL; otherwise
this will be null.
Returns a List of HTTP response headers that were
returned by the remote server. Multi-valued headers are
represented as a single HTTPHeader with comma-separated
values.
[[["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-09-04 UTC."],[[["\u003cp\u003e\u003ccode\u003eHTTPResponse\u003c/code\u003e is a class that represents the results of an \u003ccode\u003eHTTPRequest\u003c/code\u003e made via the \u003ccode\u003eURLFetchService\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThis class implements the \u003ccode\u003eSerializable\u003c/code\u003e interface and inherits several methods from the \u003ccode\u003eObject\u003c/code\u003e class, such as \u003ccode\u003eclone()\u003c/code\u003e, \u003ccode\u003eequals()\u003c/code\u003e, and \u003ccode\u003etoString()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eHTTPResponse\u003c/code\u003e constructor takes in the response code, content, final URL after any redirects, and a list of HTTP headers as parameters.\u003c/p\u003e\n"],["\u003cp\u003eMethods like \u003ccode\u003egetContent()\u003c/code\u003e, \u003ccode\u003egetFinalUrl()\u003c/code\u003e, \u003ccode\u003egetHeaders()\u003c/code\u003e, \u003ccode\u003egetHeadersUncombined()\u003c/code\u003e, and \u003ccode\u003egetResponseCode()\u003c/code\u003e provide access to the various components of the HTTP response.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egetHeaders()\u003c/code\u003e and \u003ccode\u003egetHeadersUncombined()\u003c/code\u003e provide the headers returned by the server, one combines headers with multiple values, while the other does not.\u003c/p\u003e\n"]]],[],null,["# Class HTTPResponse (2.0.0)\n\n public class HTTPResponse implements Serializable\n\n`HTTPResponse` encapsulates the results of a `\nHTTPRequest` made via the `URLFetchService`. \n\nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e HTTPResponse \n\nImplements\n----------\n\n[Serializable](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html) \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### HTTPResponse(int responseCode, byte @Nullable \\[\\] content, @Nullable URL finalUrl, List\\\u003cHTTPHeader\\\u003e headers)\n\n public HTTPResponse(int responseCode, byte @Nullable [] content, @Nullable URL finalUrl, List\u003cHTTPHeader\u003e headers)\n\nConstruct an HTTPResponse object.\n\nMethods\n-------\n\n### getContent()\n\n public byte @Nullable [] getContent()\n\nReturns the content of the request, or null if there is no\ncontent present (e.g. in a HEAD request).\n\n### getFinalUrl()\n\n public @Nullable URL getFinalUrl()\n\nReturns the final URL the content came from if redirects were followed\nautomatically in the request, if different than the input URL; otherwise\nthis will be null.\n\n### getHeaders()\n\n public List\u003cHTTPHeader\u003e getHeaders()\n\nReturns a `List` of HTTP response headers that were\nreturned by the remote server. Multi-valued headers are\nrepresented as a single `HTTPHeader` with comma-separated\nvalues.\n\n### getHeadersUncombined()\n\n public List\u003cHTTPHeader\u003e getHeadersUncombined()\n\nReturns a `List` of HTTP response headers that were\nreturned by the remote server. These are not combined for\nrepeated values.\n\n### getResponseCode()\n\n public int getResponseCode()\n\nReturns the HTTP response code from the request (e.g. 200, 500,\netc.)."]]