9.0 Released! → Native ESM runtimes 🚀, Vite support ⚡️, multi-window apps and more...
Read Announcement

Call Signature

ts
function getJSON<T>(url: string): Promise<T>;

Defined in: http/index.d.ts:23

Downloads the content from the specified URL as a string and returns its JSON.parse representation.

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDescription
urlstringThe URL to request from.

Returns

Promise<T>

Call Signature

ts
function getJSON<T>(options: HttpRequestOptions): Promise<T>;

Defined in: http/index.d.ts:29

Downloads the content from the specified URL as a string and returns its JSON.parse representation.

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDescription
optionsHttpRequestOptionsAn object that specifies various request options.

Returns

Promise<T>

Previous
getImage