【问题标题】:How to make an external request in azure mobile services from custom web api如何从自定义 Web api 在 azure 移动服务中发出外部请求
【发布时间】:2014-02-08 22:01:30
【问题描述】:

我正在尝试从我的自定义 azure 移动服务 Web api 发出外部请求。 我知道它运行节点 js,所以我搜索了解决方案....我想出了这个解决方案:

exports.get = function(request, response) {

    var http = require('http');

    http.get("YOURSITE", 
    function(res) {
      console.log("Got response: " + res.statusCode);
    }).on('error', function(e) {
      console.log("Got error: " + e.message);
    }); 

    response.send(statusCodes.OK, { message : 'YOURMESSAGE' });
};

  I get the following message: connect EACCES which means that I don't have the right permission... Besided this, I went to the configure tab in my mobile service and added at The Cross-origin resource sharing MYSITE, but I was pretty sure it won't help...

你有什么建议吗?

【问题讨论】:

    标签: node.js azure azure-mobile-services


    【解决方案1】:

    我没有专心,我输入了本地 IP 地址,这就是我无法访问的原因。这适用于外部 ips。

    【讨论】:

      猜你喜欢
      • 2014-05-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-04-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多