Longbridge OpenAPI SDK
    Preparing search index...

    Class HttpClient

    Index

    Constructors

    Methods

    • Create a new HttpClient using API Key authentication

      LONGBRIDGE_HTTP_URL is read from the environment automatically. Passing httpUrl overrides that value.

      Parameters

      • appKey: string

        App key

      • appSecret: string

        App secret

      • accessToken: string

        Access token

      • OptionalhttpUrl: string | null

        HTTP endpoint url override (reads LONGBRIDGE_HTTP_URL from env if omitted; falls back to https://openapi.longbridge.com)

      Returns HttpClient

    • Create a new HttpClient from environment variables (API Key mode)

      It first reads the .env file in the current directory.

      Variables

      • LONGBRIDGE_HTTP_URL - HTTP endpoint url
      • LONGBRIDGE_APP_KEY - App key
      • LONGBRIDGE_APP_SECRET - App secret
      • LONGBRIDGE_ACCESS_TOKEN - Access token

      Returns HttpClient

    • Create a new HttpClient from an OAuth handle

      LONGBRIDGE_HTTP_URL is read from the environment automatically. Passing httpUrl overrides that value.

      Parameters

      • oauth: OAuth

        OAuth handle obtained from OAuth.build(...)

      • OptionalhttpUrl: string | null

        HTTP endpoint url override (reads LONGBRIDGE_HTTP_URL from env if omitted; falls back to https://openapi.longbridge.com)

      Returns HttpClient

    • Performs a HTTP request

      Parameters

      • method: string
      • path: string
      • Optionalheaders: Record<string, string> | null
      • Optionalbody: any

      Returns Promise<any>