November 2019
Beginner
804 pages
20h 1m
English
You can, in fact, very easily implement the rest of the methods for the indicator API calls.
Here's a utility function that will heavily simplify the implementation of our contract:
async getIndicatorData(indicator: WorldBankApiV2Indicators, country: Country, dateRange: string, perPage: number): Promise<DataPoint[]> {
const response: Response = await fetch(`${this.getBaseIndicatorApiUrlFor(indicator, country)}?${WorldBankApiV2Params.FORMAT}=${WorldBankApiV2Formats.JSON}&${WorldBankApiV2Params.PER_PAGE}=${perPage}&${WorldBankApiV2Params.DATE}=${dateRange}`); const checkedResponse: Response = await this.checkResponseStatus(response);
let jsonContent: unknown = await this.getJsonContent(checkedResponse); const ...Read now
Unlock full access