Share via


HttpsResponse Class

  • java.lang.Object
    • com.microsoft.azure.sdk.iot.device.transport.https.HttpsResponse

public class HttpsResponse

An HTTPS response. Contains the status code, body, header fields, and error reason (if any).

Constructor Summary

Modifier Constructor Description
protected HttpsResponse()
HttpsResponse(int status, byte[] body, Map<String,List<String>> headerFields, byte[] errorReason)

Constructor.

Method Summary

Modifier and Type Method and Description
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

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

HttpsResponse

protected HttpsResponse()

HttpsResponse

public HttpsResponse(int status, byte[] body, Map> headerFields, byte[] errorReason)

Constructor.

Parameters:

status - the HTTPS status code.
body - the response body.
headerFields - a map of header field names and the values associated with the field name.
errorReason - the error reason.

Method Details

getBody

public byte[] getBody()

Getter for the response body.

Returns:

the response body.

getErrorReason

public byte[] getErrorReason()

Getter for the error reason.

Returns:

the error reason.

getHeaderField

public String getHeaderField(String field)

Getter for a header field.

Parameters:

field - the header field name.

Returns:

the header field value. If multiple values are present, they are returned as a comma-separated list according to RFC2616.

Throws:

java.lang.IllegalArgumentException - if no value exists for the given field name.

getHeaderFields

public Map getHeaderFields()

Getter for the header fields.

Returns:

a copy of the header fields for this response.

getStatus

public int getStatus()

Getter for the HTTPS status code.

Returns:

the HTTPS status code.

Applies to