![](/img/trans.png)
[英]Proper place to request an oAuth2 bearer token so it could be used by a registered HttpClient in a .NET Core web application
[英]For a POST request, where is the entry point in NET Core Web application (so that I can place a breakpoint there)?
我的 Postman POST 请求从未到达其在 controller 中的公共端点。我从 web 应用程序(在本地主机端口上运行)返回的响应是该应用程序的 static index.html 页面。
我想通过在应用程序的请求“入口点”放置一个断点来调试请求发生了什么,并弄清楚为什么它永远不会到达我的 controller。我应该在哪里放置断点?
端点。 请注意这是一个公共端点:
[HttpPost("endpointName")]
public async Task<ActionResult> myEndpoint() {
return Ok();
}
Postman POST请求:https://localhost:44123/api/endpointName
授权:无授权
其他请求(公共端点和私有端点)似乎工作正常。
请让我知道我可以在哪里放置断点来调试此请求。
固定的:
愚蠢的错误。
我忘了在 /api/ 之后添加“myEndpoints”
https://localhost:44123/api/ myEndpoints /endpointName
检查您的 API 中的命名错误,并检查您是否在任何其他文件中指定了与您的 controller 相同的名称。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.