- fetchData(dataLoc, format?): Promise<any | string>
Parameters
- dataLoc: string
Optionalformat: string = 'json'
Returns Promise<any | string>
- A promise that resolves to the fetched data: parsed JSON (if format is 'json') or raw text (if format is 'text').
Fetches data from a specified URL and returns it in the requested format.