Interface NumberResponse

Response from a http request. Acts & can be used like a number 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. Also thruthy & falsy will work again

    Returns number

  • Returns a string containing a number represented in exponential notation.

    Parameters

    • Optional fractionDigits: number

      Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.

    Returns string

  • Returns a string representing a number in fixed-point notation.

    Parameters

    • Optional fractionDigits: number

      Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.

    Returns string

  • Converts a number to a string by using the current or specified locale.

    Parameters

    • Optional locales: string | string[]

      A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.

    • Optional options: NumberFormatOptions

      An object that contains one or more properties that specify comparison options.

    Returns string

  • Converts a number to a string by using the current or specified locale.

    Parameters

    • Optional locales: LocalesArgument

      A locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.

    • Optional options: NumberFormatOptions

      An object that contains one or more properties that specify comparison options.

    Returns string

  • Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.

    Parameters

    • Optional precision: number

      Number of significant digits. Must be in the range 1 - 21, inclusive.

    Returns string

  • Returns a string representation of an object.

    Parameters

    • Optional radix: number

      Specifies a radix for converting numeric values to strings. This value is only used for numbers.

    Returns string

  • Returns the primitive value of the specified object.

    Returns number

Generated using TypeDoc