android - 400 错误请求从 android 访问 ASP.NET mvc 4 应用程序

标签 android asp.net-mvc-4 cordova

我有一个在 Android 模拟器上运行的 phonegapp 应用程序,我想访问我的 ASP.NET MVC 4 服务器以发出登录请求。

问题是我的模拟器无法访问我的 IIS 应用程序。 我试过这个:

  1. 使用 10.0.2.2:port 从 android 导航器引用我的网站。
  2. 使用我的本地 ip 地址 (192.168.0.1:port)
  3. 禁用我的防火墙
  4. 在我的 IISExpress 配置文件中更改绑定(bind)

尽管如此,我还是收到“400 错误请求错误无效用户名”...

谁能帮帮我?

最佳答案

我遇到了同样的问题。 android 模拟器无法识别 url 中的端口号。所以当我打开 visual studio 项目设置时,我将 IIS 设置更改为在本地主机下有一个虚拟目录(例如“localhost/testPorject”)而不是“localhost:PortNumer”。这行得通并且模拟器识别了它。

关于android - 400 错误请求从 android 访问 ASP.NET mvc 4 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17293792/

相关文章:

ios - 在 IOS 上调试 Ionic 应用程序?

android - 如何找到被点击的地方或路径 VectorDrawable

c# - DbGeometry 使有效?

asp.net-mvc-4 - 开发和测试网站和广告

cordova - 安装失败 'cordova-plugin-firebase-authentication' : Error: pod: Command failed with exit code 1

android - 手机间隙 : Change style to holo (changing in manifest leading to build errors)

android - 模拟器问题:wipe all user data in emulator

android - 为什么我无法从我的 Android 设备连接到 IISExpress?

android - 创建一个简单的 ExoPlayer 实例

c# - 试图避免服务器上的流量