Enable passing headers (and possibly credentials) to fetch?
See original GitHub issueHello,
I am using “arcgis-rest-js” library to query a secured Web-tiers ArcGIS Server from NodeJS backend.
The ArcGIS Server is not federated to a Portal so I cannot use the built-in Oauth mechanism.
I am able to query the ArcGIS Server using fetch by specifiying a cookie to add in the request:
fetch(agsUrl, { headers: { Cookie: mycookie } })
but I am under the impression that it is not possible with this library or did I miss anything ?
Thanks for your help and for this well-documented library !
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (8 by maintainers)
Top Results From Across the Web
Using the Fetch API - MDN Web Docs
Sending a request with credentials included ... To cause browsers to send a request with credentials included on both same-origin and cross-origin ...
Read more >Fetch: Cross-Origin Requests - The Modern JavaScript Tutorial
If the server agrees to accept the request with credentials, it should add a header Access-Control-Allow-Credentials: true to the response, in ...
Read more >How to send data using fetch and POST request with ...
you need to pass headers like this in your fetch request for post method: { credentials: 'include', mode: 'cors', method: 'POST', headers: ...
Read more >Handling cookies with Fetch's credentials - Zell Liew
Fetch has a credentials option that can be used to send credentials to servers. It has three possible values — omit , same-origin...
Read more >Fetch Standard
Header names starting with ` Sec- ` are reserved to allow new ... cross-origin and allow for more versatile fetches than possible with ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jgravois I’ll go ahead and log another issue or now, as it really is a separate, but probably a pretty low priority. I’ll be sure include my work around in the new issue in case anyone else stumbles onto the same problem.
In the meantime, I was able to solve my issue using a custom fetch with cookie management: