• import { request } from '@esri/arcgis-rest-request';
    //
    request('https://www.arcgis.com/sharing/rest')
    .then(response) // response.currentVersion === 5.2
    //
    request('https://www.arcgis.com/sharing/rest', {
    httpMethod: "GET"
    })
    //
    request('https://www.arcgis.com/sharing/rest/search', {
    params: { q: 'parks' }
    })
    .then(response) // response.total => 78379

    Generic method for making HTTP requests to ArcGIS REST API endpoints.

    Parameters

    • url: string

      The URL of the ArcGIS REST API endpoint.

    • Optional requestOptions: IRequestOptions

      Options for the request, including parameters relevant to the endpoint.

    Returns Promise<any>

    A Promise that will resolve with the data from the response.