Constructors
constructor
- new HttpClient(httpUrl, appKey, appSecret, accessToken): HttpClient
Parameters
- httpUrl: string
- appKey: string
- appSecret: string
- accessToken: string
Methods
request
- request(method, path, headers?, body?): 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