How can I use HTTPS in AngularJS?

前端 未结 3 1301
执念已碎
执念已碎 2020-12-01 01:03

I am using AngularJS, $resource & $http and working with apis, however due to security reason I need to make an HTTPS request (wor

3条回答
  •  半阙折子戏
    2020-12-01 01:44

    I've recently run into similar issues using Angular 1.2.26, but only when interacting through a load-balancer - which may be stripping https-related headers...not sure of cause yet. I've resorted to this:

    uri = $location.protocol() + "://" + $location.host() + "/someUrl"
    

    You might want to add $location.port() also if using a non-standard port.

提交回复
热议问题