Interface BooleanResponse

Response from a http request. Acts & can be used like a boolean including the data

Hierarchy

Properties

This will include the complete response without pretending to be a different type

clientError: boolean

Will be true if status code is between 400 and 499

data: string | JSONData

The body of the response

errorMsg?: string

If an error occured, this will be the error message

headers: {
    cache-control?: string;
    content-length?: string;
    content-type?: string;
    date?: string;
    server?: string;
    [key: string]: string | undefined;
}

Response headers in lowercase

Type declaration

  • [key: string]: string | undefined
  • Optional cache-control?: string
  • Optional content-length?: string
  • Optional content-type?: string
  • Optional date?: string
  • Optional server?: string
knorryError: boolean

Specifies if there was an error produced by the client (knorry)

serverError: boolean

Will be true if status code is between 500 and 599

status: number
statusText: string
successful: boolean

Represents wether the status code indicates that the request was successful or not. NOTE: This won't always be true if a knorryError occured

Methods

  • Returns the plain response so the typeof operator works again

    Returns boolean

  • Returns the primitive value of the specified object.

    Returns boolean

Generated using TypeDoc