Alternative to Workers that allows use of XMLHttpRequest

So I just needed to create an endpoint for this project I'm building, and in the endpoint I make a call that happens to make a XLMHttpRequest, does cloudflare offer an alternative resource that would let me make the call? Or do I need to create a serverless function with vercel and call that endpoint it wouldn't be ideal, but seems the only way to solve my problem currently, unless there are different serverless functions within Cloudflare that can handle XMLHttpRequests.
2 Replies
James
James4w ago
You would need to use fetch() to make these calls: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
MDN Web Docs
Fetch API - Web APIs | MDN
The Fetch API provides an interface for fetching resources (including across the network). It is a more powerful and flexible replacement for XMLHttpRequest.
alig
aligOP4w ago
Ok yea the issue is that it’s a package I used that makes an xmlhttprequest I was able to fix this issue though thanks
Want results from more Discord servers?
Add your server