HttpResponse Class
- java.
lang. Object - com.
microsoft. azure. sdk. iot. service. transport. http. HttpResponse
- com.
public class HttpResponse
An HTTPS response. Contains the status code, body, header fields, and error reason (if any).
Field Summary
Modifier and Type | Field and Description |
---|---|
protected final byte[] | body |
protected final byte[] | errorReason |
protected final java.util.Map<java.lang.String,java.lang.String> | headerFields |
protected final int | status |
Constructor Summary
Modifier | Constructor | Description | |
---|---|---|---|
protected | HttpResponse() | ||
HttpResponse(int status, byte[] body, Map<String,List<String>> headerFields, byte[] errorReason) |
Constructor. |
Method Summary
Modifier and Type | Method and Description |
---|---|
protected static java.lang.String | canonicalizeFieldName(String field) |
protected static java.lang.String | flattenValuesList(List<String> values) |
byte[] |
getBody()
Getter for the response body. |
byte[] |
getErrorReason()
Getter for the error reason. |
java.lang.String |
getHeaderField(String field)
Getter for a header field. |
java.util.Map<java.lang.String,java.lang.String> |
getHeaderFields()
Getter for the header fields. |
int |
getStatus()
Getter for the HTTPS status code. |
Methods inherited from java.lang.Object
Field Details
body
protected final byte[] body
errorReason
protected final byte[] errorReason
headerFields
protected final Map
status
protected final int status
Constructor Details
HttpResponse
protected HttpResponse()
HttpResponse
public HttpResponse(int status, byte[] body, Map
Constructor.
Parameters:
Method Details
canonicalizeFieldName
protected static String canonicalizeFieldName(String field)
Parameters:
flattenValuesList
protected static String flattenValuesList(List
Parameters:
getBody
public byte[] getBody()
Getter for the response body.
Returns:
getErrorReason
public byte[] getErrorReason()
Getter for the error reason.
Returns:
getHeaderField
public String getHeaderField(String field)
Getter for a header field.
Parameters:
Returns:
getHeaderFields
public Map
Getter for the header fields.
Returns:
getStatus
public int getStatus()
Getter for the HTTPS status code.
Returns:
Applies to
Azure SDK for Java