weixin_33676492 2018-01-24 18:28 采纳率: 0%
浏览 52

API请求方法

var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://urlexampleapi.com",
  "method": "GET",
  "headers": {
    "Content-Type": "application/json; charset=utf-8",
    "Accept": "application/json",
    "appKey": "mykeyhere",
    "appToken": "mytokenhere"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});

Hi everyone, I want to make this request to a certain api, but I know that is insecure to pass my credentials on header. What would be the best practice to apply on this case? Any suggestion would be appreciated

Thanks!

  • 写回答

1条回答 默认 最新

  • ~Onlooker 2018-01-24 18:37
    关注

    You can prefer using https and other approach are mentioned in the following question

    how-to-send-password-securely-over-http

    评论

报告相同问题?