5

Is it some how possible to send a get request from a https website to a http address with fetch API.

fetch('http://103.82.8.194/Data/', { mode: 'no-cors' })
    .then(response => response.json())
    .then(data =>
        console.log(data)
    );

Like is it some how possible send this request from https://rionislam.github.io ?

1
  • Why do you want it? It is not possible with javascript alone in a browser that others usually use. It seems that you need to create a proxy server that receives http requests. It is best to include the data on your website instead of requesting it. Commented May 27, 2022 at 8:48

1 Answer 1

3

It's not possible to request http address from a https website directly because of the Mixed Content Security Policy, it'll be blocked by the browser.

You can use a https proxy to do so, something like: https://some-proxy-url?url=http://103.82.8.194/Data/.

or just upgrade http server to https

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.