Esri / arcgis-rest-js

compact, modular JavaScript wrappers for the ArcGIS REST API
https://developers.arcgis.com/arcgis-rest-js/
Apache License 2.0
353 stars 119 forks source link

Need more clarity in IParams documentation #850

Closed jking-gis closed 1 year ago

jking-gis commented 3 years ago

When landing on the IParams documentation https://esri.github.io/arcgis-rest-js/api/request/IParams/ it is not very clear that this object can be populated with any extra parameters that you want to add into the request. The documentation could be adjusted to make that more obvious, and potentially even give example IParams objects for methods such as "createItem" or "createItemInFolder".

My use case was that I was looking to update the thumbnail on an item, but it wasn't clear that I needed to attach that to the params object.

jgravois commented 3 years ago

a code snippet and plain language explaining that you can use the interface to sneak in any parameter you want would be a welcome addition.

for anyone interested in submitting a PR, you could crib from the example in IAuthenticationManager.

https://github.com/Esri/arcgis-rest-js/blob/f6c5f65007639ad80e496274ff81b21bc0f60812/packages/arcgis-rest-request/src/utils/IAuthenticationManager.ts#L2-L14

the new code comment would go here.