PlainResponse: {
    requestUrl: URL;
    redirectUrls: URL[];
    request: default;
    ip?: string;
    isFromCache: boolean;
    statusCode: number;
    url: string;
    timings: Timings;
    retryCount: number;
    rawBody?: Buffer;
    body?: unknown;
    ok: boolean;
} & IncomingMessageWithTimings

Type declaration

  • requestUrl: URL

    The original request URL.

  • redirectUrls: URL[]

    The redirect URLs.

  • request: default
    • options - The Got options that were set on this request.

    Note: This is not a http.ClientRequest.

  • Optionalip?: string

    The remote IP address.

    This is hopefully a temporary limitation, see lukechilds/cacheable-request#86.

    Note: Not available when the response is cached.

  • isFromCache: boolean

    Whether the response was retrieved from the cache.

  • statusCode: number

    The status code of the response.

  • url: string

    The request URL or the final URL after redirects.

  • timings: Timings

    The object contains the following properties:

    • start - Time when the request started.
    • socket - Time when a socket was assigned to the request.
    • lookup - Time when the DNS lookup finished.
    • connect - Time when the socket successfully connected.
    • secureConnect - Time when the socket securely connected.
    • upload - Time when the request finished uploading.
    • response - Time when the request fired response event.
    • end - Time when the response fired end event.
    • error - Time when the request fired error event.
    • abort - Time when the request fired abort event.
    • phases
      • wait - timings.socket - timings.start
      • dns - timings.lookup - timings.socket
      • tcp - timings.connect - timings.lookup
      • tls - timings.secureConnect - timings.connect
      • request - timings.upload - (timings.secureConnect || timings.connect)
      • firstByte - timings.response - timings.upload
      • download - timings.end - timings.response
      • total - (timings.end || timings.error || timings.abort) - timings.start

    If something has not been measured yet, it will be undefined.

    Note: The time is a number representing the milliseconds elapsed since the UNIX epoch.

  • retryCount: number

    The number of times the request was retried.

  • OptionalrawBody?: Buffer

    The raw result of the request.

  • Optionalbody?: unknown

    The result of the request.

  • ok: boolean

    Whether the response was successful.

    Note: Got throws automatically when response.ok is false and throwHttpErrors is true.