ASP.NET NameValueCollection 空,尽管 POST 在 Wireshark 中可见

本文关键字:Wireshark POST 尽管 NET NameValueCollection ASP | 更新日期: 2023-09-27 18:31:14

所以我遇到了一个问题。这是我的环境:Visual Studio 2015ASP.NET 解决方案并使用 IIS Express 进行调试。

我正在使用Chrome的Postman向我的应用程序提交POST数据,尽管在Wireshark中看到表单数据,但我无法在Page.Load中看到被命中页面的请求对象中的数据。

我可能缺少什么?

保罗

ASP.NET NameValueCollection 空,尽管 POST 在 Wireshark 中可见

我不确定为什么我的问题投了反对票。想知道为什么会很感激吗?

但是,我想让您知道我确实解决了我的问题,并且特定于RouteConfig.cs解决方案以及FriendURL的实现方式。

我最初的 Routconfig.cs 是:

public static void RegisterRoutes(RouteCollection routes)
{
    var settings = new FriendlyUrlSettings();
    settings.AutoRedirectMode = RedirectMode.Permanent;
    routes.EnableFriendlyUrls(settings);
}

我终于能够使用以下方法获取帖子数据:

public static void RegisterRoutes(RouteCollection routes)
{
    routes.EnableFriendlyUrls();
}