DCS World Typescript
    Preparing search index...

    Represents an HTTP response to be sent to a client.

    This type is used to define the structure of an HTTP response. It includes necessary information such as status code, response headers, and an optional response body.

    const httpResponse: HttpResponse = {
    status: 200,
    body: 'Hello, world!',
    headers: {
    'Content-Type': 'text/plain',
    'Cache-Control': 'no-cache'
    }
    };

    This defines a typical HTTP response with a 200 OK status, a plain text body, and
    headers for content type and cache control.
    type HttpResponse = {
        body?: string;
        headers: Record<string, string>;
        status: HttpStatus;
    }
    Index

    Properties

    Properties

    body?: string

    A string containing the body of the response. Optional.

    headers: Record<string, string>

    An object representing the HTTP headers. Keys are header names, values are the corresponding header values.

    status: HttpStatus

    A numeric HTTP status code