new HttpResponse(data [, status] [, statusText] [, headers])
Creates an instance of HttpResponse
.
Parameters:
Name | Type | Argument | Default | Description |
---|---|---|---|---|
data |
string | Blob | ArrayBuffer | The data, or body. |
||
status |
number |
<optional> |
200 | The status code. |
statusText |
string |
<optional> |
'' | The status message. |
headers |
Object |
<optional> |
The headers. |
Methods
-
getData()
-
Gets the response data.
Returns:
The data.
- Type
- string | Blob | ArrayBuffer
-
getHeader(name)
-
Gets a specific header value.
Parameters:
Name Type Description name
string The name of the header.
Returns:
The value of the header.
- Type
- string
-
getHeaders()
-
Gets the response headers.
Returns:
The headers.
- Type
- Object.<string, string>
-
getStatus()
-
Gets the response status code.
Returns:
The status.
- Type
- number
-
getStatusText()
-
Gets the response status text.
Returns:
The status.
- Type
- string