public class HttpResponse extends Object
| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
body |
protected byte[] |
errorReason |
protected Map<String,String> |
headerFields |
protected int |
status |
| Modifier | Constructor and Description |
|---|---|
protected |
HttpResponse() |
|
HttpResponse(int status,
byte[] body,
Map<String,List<String>> headerFields,
byte[] errorReason)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected static String |
canonicalizeFieldName(String field) |
protected static String |
flattenValuesList(List<String> values) |
byte[] |
getBody()
Getter for the response body.
|
byte[] |
getErrorReason()
Getter for the error reason.
|
String |
getHeaderField(String field)
Getter for a header field.
|
Map<String,String> |
getHeaderFields()
Getter for the header fields.
|
int |
getStatus()
Getter for the HTTPS status code.
|
protected final int status
protected final byte[] body
protected final byte[] errorReason
public HttpResponse(int status,
byte[] body,
Map<String,List<String>> headerFields,
byte[] errorReason)
status - The HTTPS status code.body - The response body.headerFields - The map of header field names and the values associated with the field name.errorReason - The error reason.protected HttpResponse()
public int getStatus()
public byte[] getBody()
public String getHeaderField(String field)
field - the header field name.IllegalArgumentException - if no value exists for the given field
name.public Map<String,String> getHeaderFields()
public byte[] getErrorReason()
Copyright © 2019. All rights reserved.