简体   繁体   English

对于 POST 请求,.NET Core Web 应用程序的入口点在哪里(以便我可以在那里放置断点)?

[英]For a POST request, where is the entry point in NET Core Web application (so that I can place a breakpoint there)?

My Postman POST request never reaches its public endpoint in the controller. The response I get back from my web application (running on a localhost port) is the app's static index.html page.我的 Postman POST 请求从未到达其在 controller 中的公共端点。我从 web 应用程序(在本地主机端口上运行)返回的响应是该应用程序的 static index.html 页面。

I want to debug what happens to the request by placing a breakpoint at the application's request "entry point", and figure out why it never reaches my controller. Where should I place the break point?我想通过在应用程序的请求“入口点”放置一个断点来调试请求发生了什么,并弄清楚为什么它永远不会到达我的 controller。我应该在哪里放置断点?

Endpoint.端点。 Please note this is a public endpoint:请注意这是一个公共端点:

[HttpPost("endpointName")]
public async Task<ActionResult> myEndpoint() {
    return Ok();
}

Postman POST request: https://localhost:44123/api/endpointName Postman POST请求:https://localhost:44123/api/endpointName

Authorization: No Auth授权:无授权

Other requests (both public and private endpoints) seem to work fine.其他请求(公共端点和私有端点)似乎工作正常。

Please let me know where I can place a breakpoint to debug this request.请让我知道我可以在哪里放置断点来调试此请求。

FIXED:固定的:

Stupid mistake.愚蠢的错误。

I forgot to add "myEndpoints" after /api/我忘了在 /api/ 之后添加“myEndpoints”

https://localhost:44123/api/ myEndpoints /endpointName https://localhost:44123/api/ myEndpoints /endpointName

Check for the naming error in your API, also check whether you have specified same name in any other file as your controller.检查您的 API 中的命名错误,并检查您是否在任何其他文件中指定了与您的 controller 相同的名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 请求 oAuth2 不记名令牌的适当位置,以便它可以由 .NET Core web 应用程序中的注册 HttpClient 使用 - Proper place to request an oAuth2 bearer token so it could be used by a registered HttpClient in a .NET Core web application 我如何才能将.NET Core程序的入口点放在它引用的NuGet包中 - How can I have the entry point to a .NET Core program be in a NuGet package it references 如何使用.net核心Web应用程序发布XML文档? - How can I publish XML documentation with a .net core web application? DLL文件应该放在.NET Web应用程序中 - Where DLL file should be place in .NET web application .net核心中的hangfire RecurringJob的入口点 - entry point of a hangfire RecurringJob in .net core Asp.net core 3 Web Api post 请求不起作用 - Asp.net core 3 Web Api post request not working VueJs + ASP.Net Core Web API 发出 post 请求 - VueJs + ASP.Net Core Web API Make a post request ASP.NET Core Web API:程序不包含适用于入口点的静态“ Main”方法 - ASP.NET Core Web API: Program does not contain a static 'Main' method suitable for an entry point .Net Core 3.0 Angular 应用程序发布请求参数始终为 NULL - .Net Core 3.0 Angular application post request parameter is always NULL 如何使用 post 将数据传递到另一个 .Net Core Web 应用程序 - How to pass data to another .Net Core web application using post
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM