How to access external api using sails.js?

安稳与你 提交于 2019-12-03 17:03:22

The host shouldn't include the protocol:

    var http = require('http'), options = {
        host : "graph.facebook.com",
        port : 80,
        path : "/"+other.uid+"/likes?access_token="+other.token,
        method : 'GET'
    };

If you want to use https, use the https module instead of http, and use port 443. And don't forget to add req.end() when you're done with the request.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!