[英]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.