react-native-firebase icon indicating copy to clipboard operation
react-native-firebase copied to clipboard

docs: Update axios-integration.md

Open Rohit3523 opened this issue 5 months ago • 3 comments

Description

This PR addresses an issue with the newHttpMetric function in the Firebase Performance Monitoring documentation. According to the documentation, when tracking HTTP request performance (e.g., using Axios), the HTTP method needs to be passed in uppercase. However, the config.method from Axios returns the method in lowercase, causing the following error:

[Error: firebase.perf().newHttpMetric(_, *) 'httpMethod' must be one of CONNECT, DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT, TRACE.]

As a result, this error prevents the use of httpMetric in response monitoring.

The issue was resolved by adding the toUpperCase() method to the HTTP method before passing it to newHttpMetric. The documentation has been updated to reflect this requirement.

Related issues

None

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • [x] Yes
  • My change supports the following platforms;
    • [x] Android
    • [x] iOS
  • My change includes tests;
    • [ ] e2e tests added or updated in packages/\*\*/e2e
    • [ ] jest tests added or updated in packages/\*\*/__tests__
  • [ ] I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • [ ] Yes
    • [x] No

Rohit3523 avatar Sep 13 '24 14:09 Rohit3523