【问题标题】:Can't access to the Appcelerator Cloud Services from C#无法从 C# 访问 Appcelerator 云服务
【发布时间】:2012-08-21 21:22:47
【问题描述】:

我正在尝试从用 C# 制作的应用程序连接到 ACS,首先我尝试登录但无法连接,而是收到以下错误消息:The remote server returned an error: (406) Not Acceptable。这是我的代码:

    private void btnLogin_Click(object sender, EventArgs e)
    {
        String url = "https://api.cloud.appcelerator.com/v1/users/login.json?key=esfob3KF1R2zBRh8vroMQCCMlQCP44xx&login=prueba123@mail.com&password=" + txtClave.Text;

        WebRequest wrGetUrl = WebRequest.Create(url);

        Stream objStream = wrGetUrl.GetResponse().GetResponseStream(); //I get the error in this line
        StreamReader reader = new StreamReader(objStream);

        String line = reader.ReadToEnd();

        MessageBox.Show(line);
    }

我可以进行查询,但对于那些我不需要登录的人,在我正在工作的应用程序中,我还必须创建PhotosCustom Objects。有人可以帮我解决这个问题吗?

【问题讨论】:

    标签: c# rest cloud appcelerator


    【解决方案1】:

    根据the documentation,该调用需要使用POST方法:

    wrGetUrl.Method = "POST";
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-12
      • 2012-08-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多