Share via


InvokeResponse Class

  • java.lang.Object
    • com.microsoft.bot.builder.InvokeResponse

public class InvokeResponse

Tuple class containing an HTTP Status Code and a JSON Serializable object. The HTTP Status code is, in the invoke activity scenario, what will be set in the resulting POST. The Body of the resulting POST will be the JSON Serialized content from the Body property.

Constructor Summary

Constructor Description
InvokeResponse(int withStatus, Object withBody)

Initializes new instance of InvokeResponse.

Method Summary

Modifier and Type Method and Description
java.lang.Object getBody()

Gets the body content for the response.

boolean getIsSuccessStatusCode()

Returns if the status of the request was successful.

int getStatus()

Gets the HTTP status code for the response.

void setBody(Object withBody)

Sets the body content for the response.

void setStatus(int withStatus)

Sets the HTTP status code for the response.

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

InvokeResponse

public InvokeResponse(int withStatus, Object withBody)

Initializes new instance of InvokeResponse.

Parameters:

withStatus - The invoke response status.
withBody - The invoke response body.

Method Details

getBody

public Object getBody()

Gets the body content for the response.

Returns:

The body content.

getIsSuccessStatusCode

public boolean getIsSuccessStatusCode()

Returns if the status of the request was successful.

Returns:

True if the status code is successful, false if not.

getStatus

public int getStatus()

Gets the HTTP status code for the response.

Returns:

The HTTP status code.

setBody

public void setBody(Object withBody)

Sets the body content for the response.

Parameters:

withBody - The body content.

setStatus

public void setStatus(int withStatus)

Sets the HTTP status code for the response.

Parameters:

withStatus - The HTTP status code.

Applies to