reyemtm / agol-cache

A NodeJS script to download all layers within a public or protected ArcGIS Online Feature or Map Service as GeoJSON.
https://www.npmjs.com/package/agol-cache
MIT License
7 stars 4 forks source link

Support custom headers #19

Open stevage opened 5 months ago

stevage commented 5 months ago

I have a case where a server requires Authorization headers.

In my own fork, I solved this by adding an option to pass your own fetch function. The one I pass is node-fetch but adds the required header.

reyemtm commented 5 months ago

interesting - I could add a headers into the options, prob as an array of either text or json obj - and you're doing this instead of adding a token - or just so you don't need a token? I have some code elsewhere that fetches a token I could add into here

reyemtm commented 5 months ago

I pushed my latest code to GH. Lots of changes - most have been tested. I did not add in this layers option yet or the headers option. If you want to work on it and push changes feel free.

On Jun 3, 2024, at 7:18 AM, Steve Bennett @.***> wrote:

I have a case where a server requires Authorization headers.

In my own fork, I solved this by adding an option to pass your own fetch function. The one I pass is node-fetch but adds the required header.

— Reply to this email directly, view it on GitHub https://github.com/reyemtm/agol-cache/issues/19, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQ2HUMIE4CTRDY363ZIYKTZFRGI3AVCNFSM6AAAAABIWJJGY2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGMZTAOBXGYYDGMQ. You are receiving this because you are subscribed to this thread.

stevage commented 5 months ago

and you're doing this instead of adding a token - or just so you don't need a token?

It's not my server - they set it up to do authentication this way, so I have to play along.