The details of the HTTP request to report. See ReportWebRequestOptions for the required and optional fields.
import * as nativeHttp from "@dynatrace/rum-javascript-sdk/api/native-http";
const start = Date.now();
myHttpPlugin.get("https://api.example.com/users", (response) => {
nativeHttp.reportWebRequest({
url: "https://api.example.com/users",
method: "GET",
startTime: start,
duration: Date.now() - start,
statusCode: response.status
});
});
Safe wrapper for dynatrace.nativeHttp.reportWebRequest which reverts to a noop if RUM JavaScript or the native HTTP module is not available.