27 May 2022 08:30 PM - edited 27 May 2022 08:31 PM
We are having difficulties to find a solution for capturing xhr response.
some of our xhr response would get intercept by a gateway/firewall and response back with plain text error. (without hitting our app server)
we want to find out how many xhr calls actually hit by firewall and response with "request denied" message.
Is there a way we can capture/check xhr response from the client side?
I have checked "add action properties" and "add custom errors rule".
Didnt look liked either one can validate or capture xhr requests. the xhr requests we have triggered 3-4 times on the background.
Solved! Go to Solution.
29 May 2022 09:03 PM
If you response is HTTP 2xx with just the payload "request denied", then it's not possible to capture this directly with Dynatrace without modifying your app. Dynatrace does not capture any payload (RUM or server-side). So the check must be performed in your app in the XHR callback and you can send the error using the RUM JavaScript API (dtrum.reportError() or dtrum.reportCustomError()). See more here.