public class ResourceResponse extends Object
WebView requests a certain resource.| 构造器 | 说明 |
|---|---|
ResourceResponse(String mimeType,
InputStream data,
String charset) |
A constructor used to create a
ResourceResponse instance. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
String |
getCharset() |
Obtains the encoding for the data of the resource response.
|
InputStream |
getData() |
Obtains the data of the resource response.
|
Map<String,String> |
getHeaders() |
Obtains HTTP header information of the resource response.
|
String |
getMimeType() |
Obtains the MIME type of the resource response.
|
String |
getReason() |
Obtains the reason for the status of the resource response.
|
int |
getStatus() |
Obtains the status of the resource response.
|
void |
setData(InputStream data,
String charset) |
Sets the data of the resource response and the encoding.
|
void |
setHeaders(Map<String,String> headers) |
Sets HTTP header information for the resource response.
|
void |
setMimeType(String mimeType) |
Sets the MIME type for the resource response.
|
void |
setStatusAndReason(int status,
String reason) |
Sets the status of the resource response and the reason.
|
public ResourceResponse(String mimeType, InputStream data, String charset)
ResourceResponse instance.mimeType - Indicates the MIME type of the resource response.data - Indicates the data of the resource response.charset - Indicates the encoding for the data of the resource response.public Map<String,String> getHeaders()
public void setHeaders(Map<String,String> headers)
headers - Indicates the HTTP header information.public InputStream getData()
public String getCharset()
public void setData(InputStream data, String charset)
data - Indicates the data of the resource response.charset - Indicates the encoding for the data of the resource response.public String getMimeType()
public void setMimeType(String mimeType)
mimeType - Indicates the MIME type of the resource response.public int getStatus()
public String getReason()
public void setStatusAndReason(int status,
String reason)
status - Indicates the status code, which is a number in the range of [100, 299] or [400, 599].reason - Indicates the reason for the status of the resource response.