繁体   English   中英

Angular 请求和响应正文进入应用程序洞察

[英]Angular Request & response body into application insights

我看过很多关于请求和响应正文的文章,了解 C# API 的应用程序洞察力。 我想知道是否有人在 angular 中有任何这样做的例子。 我已经在我的 SPA 解决方案中获得了洞察力,但我不确定如何从 Angular SPA 中专门获得 HTTP 响应和请求以显示洞察力。

我会寻找与此类似的东西( https://www.azureblue.io/how-to-log-http-request-body-with-asp-net-core-application-insights/ ),但对于 angular。

C# 示例只是实现了一些中间件来处理请求/响应。 这很容易在 angular 中使用 HttpInterceptors 实现。 我建议阅读如何实现这些拦截器来处理您认为合适的请求和响应,以及在您的 app.module.ts 提供程序数组中注册 HttpInterceptor。 https://angular.io/guide/http#intercepting-requests-and-responses

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM