Constructors
constructor
- new HttpClient(
httpUrl: string,
appKey: string,
appSecret: string,
accessToken: string,
): HttpClient Parameters
- httpUrl: string
- appKey: string
- appSecret: string
- accessToken: string
Methods
request
- request(
method: string,
path: string,
headers?: Record<string, string>,
body?: any,
): Promise<any> Parameters
- method: string
- path: string
Optional
headers: Record<string, string>Optional
body: any
Returns Promise<any>
Create a new
HttpClient
from the given environment variablesIt first gets the environment variables from the
.env
file in the current directory.Variables
LONGPORT_HTTP_URL
- HTTP endpoint urlLONGPORT_APP_KEY
- App keyLONGPORT_APP_SECRET
- App secretLONGPORT_ACCESS_TOKEN
- Access token