request

Function

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

Parameter Type Default Notes
url Required string

The URL of the ArcGIS REST API endpoint.

requestOptions Optional IRequestOptions { params: { f: "json" } }

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

Returns

Promise<any> - A Promise that will resolve with the data from the response.


Function defined in packages/arcgis-rest-request/src/request.ts:101