Client Script JavaScript Fetch API availability
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2023 11:44 AM - edited 04-12-2023 02:33 PM
Does anyone knows what is the best method to directly access an external REST service from a Client Script ?
I searched for a while and found that the current method of doing that in JavaScript is to use the fetch() method.
That is the newer Promise version of the very old XMLHttpRequest JavaScript callback class.
The intent here is to access external web sites from the client scripts to get external data and do external data validations.
The only issue I can see is when we have to use access keys or codes to get to the expected external data.
In that case, I believe the access keys or codes do get exposed in the browser, which is really not good.
If anyone has ideas around that too, it would be great to hear about them.
Thank you for any insights you can provide.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2023 03:21 PM
Hi, I would use GlideAjax to call a script-include function that manages\runs your REST query,
but any suspect the solution could result in a slow\poor user experience, so if possible ensure you build in a way that doesn't have the user waiting for a response.