public
IncomingHttpResponse(HttpResponse response, String content)
Creates an IncomingHttpResponse from a successful response and the content read
from it. The caller is expected to read the content from the response, and handle any errors
that may occur while reading.
Parameters
response
A successful response.
content
Content read from the response.
public
IncomingHttpResponse(HttpResponseException e, HttpRequest request)
Creates an IncomingHttpResponse from an HTTP error response.
Parameters
e
The exception representing the HTTP error response.
request
The request that resulted in the error.
public
IncomingHttpResponse(HttpResponseException e, OutgoingHttpRequest request)
Creates an IncomingHttpResponse from an HTTP error response.
Parameters
e
The exception representing the HTTP error response.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2021-04-28 UTC."],[],[],null,["# IncomingHttpResponse\n\npublic final class **IncomingHttpResponse** extends Object \nContains information that describes an HTTP response received by the SDK. \n\n### Public Constructor Summary\n\n|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | [IncomingHttpResponse](/docs/reference/admin/java/reference/com/google/firebase/IncomingHttpResponse#IncomingHttpResponse(com.google.api.client.http.HttpResponse, java.lang.String))(HttpResponse response, String content) Creates an `IncomingHttpResponse` from a successful response and the content read from it. |\n| | [IncomingHttpResponse](/docs/reference/admin/java/reference/com/google/firebase/IncomingHttpResponse#IncomingHttpResponse(com.google.api.client.http.HttpResponseException, com.google.api.client.http.HttpRequest))(HttpResponseException e, HttpRequest request) Creates an `IncomingHttpResponse` from an HTTP error response. |\n| | [IncomingHttpResponse](/docs/reference/admin/java/reference/com/google/firebase/IncomingHttpResponse#IncomingHttpResponse(com.google.api.client.http.HttpResponseException, com.google.firebase.OutgoingHttpRequest))(HttpResponseException e, [OutgoingHttpRequest](/docs/reference/admin/java/reference/com/google/firebase/OutgoingHttpRequest) request) Creates an `IncomingHttpResponse` from an HTTP error response. |\n\n### Public Method Summary\n\n|-----------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| String | [getContent](/docs/reference/admin/java/reference/com/google/firebase/IncomingHttpResponse#getContent())() Returns the content of the response as a string. |\n| Map\\\u003cString, Object\\\u003e | [getHeaders](/docs/reference/admin/java/reference/com/google/firebase/IncomingHttpResponse#getHeaders())() Returns the headers set on the response. |\n| [OutgoingHttpRequest](/docs/reference/admin/java/reference/com/google/firebase/OutgoingHttpRequest) | [getRequest](/docs/reference/admin/java/reference/com/google/firebase/IncomingHttpResponse#getRequest())() Returns the request that resulted in this response. |\n| int | [getStatusCode](/docs/reference/admin/java/reference/com/google/firebase/IncomingHttpResponse#getStatusCode())() Returns the status code of the response. |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|------------------|---------------------------|\n| Object | clone() |\n| boolean | equals(Object arg0) |\n| void | finalize() |\n| final Class\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| String | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nPublic Constructors\n-------------------\n\n#### public\n**IncomingHttpResponse**\n(HttpResponse response, String content)\n\nCreates an `IncomingHttpResponse` from a successful response and the content read\nfrom it. The caller is expected to read the content from the response, and handle any errors\nthat may occur while reading. \n\n##### Parameters\n\n| response | A successful response. |\n| content | Content read from the response. |\n|----------|---------------------------------|\n\n#### public\n**IncomingHttpResponse**\n(HttpResponseException e, HttpRequest request)\n\nCreates an `IncomingHttpResponse` from an HTTP error response. \n\n##### Parameters\n\n| e | The exception representing the HTTP error response. |\n| request | The request that resulted in the error. |\n|---------|-----------------------------------------------------|\n\n#### public\n**IncomingHttpResponse**\n(HttpResponseException e, [OutgoingHttpRequest](/docs/reference/admin/java/reference/com/google/firebase/OutgoingHttpRequest) request)\n\nCreates an `IncomingHttpResponse` from an HTTP error response. \n\n##### Parameters\n\n| e | The exception representing the HTTP error response. |\n| request | The request that resulted in the error. |\n|---------|-----------------------------------------------------|\n\nPublic Methods\n--------------\n\n#### public String\n**getContent**\n()\n\nReturns the content of the response as a string. \n\n##### Returns\n\n- HTTP content or null. \n\n#### public Map\\\u003cString, Object\\\u003e\n**getHeaders**\n()\n\nReturns the headers set on the response. \n\n##### Returns\n\n- An immutable map of headers (possibly empty). \n\n#### public [OutgoingHttpRequest](/docs/reference/admin/java/reference/com/google/firebase/OutgoingHttpRequest)\n**getRequest**\n()\n\nReturns the request that resulted in this response. \n\n##### Returns\n\n- An HTTP request. \n\n#### public int\n**getStatusCode**\n()\n\nReturns the status code of the response. \n\n##### Returns\n\n- An HTTP status code (e.g. 500)."]]