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# 示例只是实现了一些中间件来处理 requests/responses。这在 angular 中使用 HttpInterceptors 很容易实现。我建议阅读如何实现这些拦截器以处理您认为合适的请求和响应,以及在 app.module.ts providers 数组中注册 HttpInterceptor。 https://angular.io/guide/http#intercepting-requests-and-responses
我看过很多关于对 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# 示例只是实现了一些中间件来处理 requests/responses。这在 angular 中使用 HttpInterceptors 很容易实现。我建议阅读如何实现这些拦截器以处理您认为合适的请求和响应,以及在 app.module.ts providers 数组中注册 HttpInterceptor。 https://angular.io/guide/http#intercepting-requests-and-responses