1

I'm trying to get an HTTP request from locationiq.org

My code is as follows:

this.http.get('https://locationiq.org/v1/reverse.php?format=json&key=9753acbde443c3&lat=' + this.appWide.lat + '&lon=' + this.appWide.long)

However, the request isn't going to the https URL, but rather performing a non-secure request. I know this since I get the error:

Mixed Content: The page at 'myurl' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://locationiq.org/v1/reverse.php?format=json&key=9753acbde443c3&lat=31.76&lon=35.21371'. This request has been blocked; the content must be served over HTTPS.

How can I make sure that the request is on the https url?

7
  • maybe it redirects you to http, try to test it in browser and see if it change Commented Apr 23, 2018 at 18:20
  • @Hussein when I type the url in the browser without https, it redirects to http, but when I type it with https, it stays on https. Commented Apr 23, 2018 at 18:42
  • do ctrl+shift+i on chrome and open up network tab and make the request. You will notice that request there and can check if its doing http or https. Commented Apr 23, 2018 at 19:08
  • @fastAsTortoise where do I see that there? Commented Apr 23, 2018 at 19:14
  • 1
    Then its the issue on the service side. they have to enable https or you can also use proxy server to make this request work Commented Apr 23, 2018 at 20:20

1 Answer 1

1

The Page you are calling at myurl has hardcoded http references like images src="http://... or stylesheets href="http:// this is a problem of the server site and should be fixed there.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.