【问题标题】:Angular Request & response body into application insightsAngular 请求和响应正文到应用程序洞察力
【发布时间】:2021-06-08 11:37:41
【问题描述】:

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

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

【问题讨论】:

    标签: angular azure-application-insights


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-12-22
      • 1970-01-01
      • 1970-01-01
      • 2020-11-17
      • 2016-09-17
      • 1970-01-01
      • 1970-01-01
      • 2015-11-10
      相关资源
      最近更新 更多