Closed yankuanz closed 3 years ago
Hum I am getting this error and can not find anything in the docs!
It seems like you should use setDefaultRequestOptions
and pass the token
value in the params
It seems like you should use
setDefaultRequestOptions
and pass thetoken
value in theparams
Thanks @vicb . Will give it a shot!
Here is what I use successfuly:
import { geocode } from '@esri/arcgis-rest-geocoding';
import { setDefaultRequestOptions } from '@esri/arcgis-rest-request';
setDefaultRequestOptions({ params: { token: "...your API key..." } });
const { candidates } = await geocode(address);
In our app we recently encountered a regression when using
suggest
andgeocode
(we used to make the these requests without passing in anyauthentication
) because of the change of the default geocode URL https://github.com/Esri/arcgis-rest-js/commit/613837ddaa0638f826aa75d11c00ee1007cb6e72:Would assume everthing should just work before and after the URL update. Is this expected?
So once we did pass in this time, we got another error
Note that we are making the requests from devext tier. Is this also expected? What would be best practice in here?
Thanks!