Chatbot API

Chatbot API Detail

HTML API Request

1
2
3
4
5
6
7
8
function reqListener () {
console.log(this.responseText);
}

var oReq = new XMLHttpRequest();
oReq.addEventListener("load", reqListener);
oReq.open("GET", "http://api.qingyunke.com/api.php?key=free&appid=0&msg=msg");
oReq.send();

Problem

  • [Warning] [blocked] The page was not allowed to run insecure content from http://api.qingyunke.com/api.php?key=free&appid=0&msg=msg
  • Origin null is not allowed by Access-Control-Allow-Origin
  • Both of the above two problems are due to Apple’s policy: Safari does not allow users to disable the block on mixed content

Solution

  • Upgrade HTTP connection to HTTPS connection
  • Proxy the content through an HTTPS connection