Home > Software engineering >  how to solve This request has been blocked; the content must be served over HTTPS
how to solve This request has been blocked; the content must be served over HTTPS

Time:08-10

how should I make this called to avoid blocking request?

const getLocation = async () => {

   const LOCATION_URL = 'http://ip-api.com/json/?fields=country,city,lat,lon,timezone';

   const response = await axios.get(LOCATION_URL);
   return response.data;
}

CodePudding user response:

Website secured by ssl (https) can only access resources that are also secured with ssl

Checking the screenshot

You have a few options now:

  1. Buy premium
  2. Use different API provider
  3. Create a backend proxy that will fetch the data and send it to you
  • Related