PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, October 13, 2022

[FIXED] how to solve This request has been blocked; the content must be served over HTTPS

 October 13, 2022     api, axios, javascript, reactjs     No comments   

Issue

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;
}

Solution

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

Checking the documentation reveals that:

256-bit SSL encryption is not available for this free API. Please see our pro service. 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


Answered By - Konrad Linkowski
Answer Checked By - Cary Denson (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing