How can I call a URL in the background without navigating away from my site?

Keep in mind that you should place this code on the backend to protect your API key from being stolen, in other words, the server should be the one sending the request, not the browser of the client.

2 Likes