Interface representing a structured response object.

ResponseObject

interface ResponseObject {
    data?: any;
    header?: { [key: string]: string };
    response: Response;
    status?: IStatusCode;
    stream?: ReadableStream;
    type?: RESPONSE_TYPE;
}

Properties

data?: any

Optional payload or body data returned from the server. Can be any valid JavaScript type.

header?: { [key: string]: string }

Optional object representing HTTP headers as key-value pairs.

response: Response

The primary response object containing the server's response. Must be of type Response.

status?: IStatusCode

Optional status information, typically representing the HTTP status code. Must be of type IStatusCode.

stream?: ReadableStream

Optional readable stream, allowing for data to be read in chunks, typically for large responses.

Optional response type indicating the nature or format of the response. Must be of type RESPONSE_TYPE.