NativeScript 9.1 Released → V8 14.9, Vite 8 HMR, built for rapid agentic visual iteration
Dig in

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