How Automatic Network Logging Works
Beagle uses React Native’sXHRInterceptor to intercept network requests without requiring any changes to your existing code. The NetworkingMonitor class handles the interception:
NetworkingLog Structure
Each network request creates aNetworkingLog entry with the following structure:
- Request: URL, HTTP method, headers, and body
- Response: Status code, headers, body, and duration
- Host: Extracted from the URL for easy filtering
- Duration: Time taken for the request in milliseconds
Viewing Request/Response Details
The Beagle inspector displays network logs with a three-tab interface:- Info Tab
- Request Tab
- Response Tab
The Info tab provides a quick overview:
- URL: Full request URL
- Method: HTTP method (GET, POST, PUT, DELETE, etc.)
- Status: HTTP status code or “Loading” for pending requests
- Duration: Request duration in milliseconds
Network Log Card Footer
In the log list view, each network request displays a compact footer with key information:Features
Network monitoring is enabled automatically when you wrap your app with
BeagleProvider. No additional configuration is required.Automatic Request Tracking
- Captures all XMLHttpRequest and fetch requests
- Records request timing automatically
- Tracks pending requests until completion
Rich Data Display
- JSON bodies are parsed and displayed in an interactive tree view
- Headers are organized in collapsible sections
- FormData and multipart requests are properly parsed