How can I use HTTPS in AngularJS?

前端 未结 3 1299
执念已碎
执念已碎 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:53

    Use the $http api as you would normally:

    $http.get('/someUrl').success(successCallback);
    

    if your app is being served over HTTPS then any calls you are making are to the same host/port etc so also via HTTPS.

    If you use the full URIs for your requests e.g. $http.get('http://foobar.com/somePath') then you will have to change your URIs to use https

提交回复
热议问题