Class HTTPRequestInternal

Class for handling HTTP requests with customizable headers, body, and parameters.

Constructors

Properties

http?: {
    code?: number;
    request?: object;
    response?: object;
}

Methods

  • Send the HTTP request.

    Parameters

    • url: string

      The URL to send the request to.

    • method: "GET" | "POST" = 'GET'

      The HTTP method to use. Defaults to 'GET'.

    • ttl: number = 60

      The TTL value for the cached data in seconds.

    Returns Promise<HTTPServerResponse>

    A Promise that resolves with the response data, or rejects with a NodeHoyoError if an error occurs.

    if an error occurs rejects with a NodeHoyoError

  • Set to used Dynamic Security or not

    Parameters

    • flag: boolean = true

      boolean Flag indicating whether to use dynamic security or not (default: true).

    Returns this

    The current Request instance.

  • Set Language

    Parameters

    • lang: string

      Language Language that used for return of API (default: Language.ENGLISH).

    Returns this