request
Functionrequest(url: string, requestOptions: IRequestOptions): Promise<any>
Generic method for making HTTP requests to ArcGIS REST API endpoints.
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
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
url | string |
| The URL of the ArcGIS REST API endpoint. |
request | 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.