无法连接到我的PC上的服务器,Web API

时间:2015-02-09 22:57:06

标签: c# jquery ajax post asp.net-web-api

我使用C#编写的OWIN和Web API在我的PC上运行本地服务器时出现问题。我用Phonegap制作了一个小应用程序,并成功使用了我手机上与模拟器的连接。现在我已将我的应用程序导出到我的iPhone,但我似乎无法将我的字符串发送到计算机上运行的服务器。

我已经使用指定端口的PC上的IP地址,但我的Ajax调用没有通过。有什么我忘了吗?

$.ajax({
        type       : "POST",
        url        : "http://192.168.178.15:9000/api/system",
        //xhrFields  : {withCredentials: true},
        crossDomain: true,
        data       : { '': "buttonOne" },
        dataType   : 'text',
        success    : function(response) {
            console.log(response);
        },
        error      : function() {
            console.error("error");
        }
    });

0 个答案:

没有答案