weixin_33736048 2016-12-14 08:03 采纳率: 0%
浏览 538

Https到HTTP请求

I am confused about these protocols. which requests are available in case of using these protocols:

  • HTTP to HTTP
  • HTTPS to HTTP
  • HTTP to HTTPS
  • HTTPS to HTTPS

I have a domain in HTTPS and a sub-domain in HTTP. Can I request from HTTPS to HTTP (POST and GET ) to retrieve data?

for example:

$.getJSON('http://api.domainName.com/api/Visitor/GetStates/' + countryId, function(data) {
  $.each(data, function(key, value) {
    $("#StateId").html($("#StateId").html() +
      "<option value='" +
      value.StateId +
      "'>" +
      value.StateName +
      "</option>"
    );
  });
}

this request is sent from: https://domainName.com/

Whats more I solved CORS problem in sub-domain.

  • 写回答

2条回答 默认 最新

  • weixin_33695082 2016-12-14 08:08
    关注

    You will need to switch the Ajax requests to https, too.

    评论

报告相同问题?