How wjsoftware/dr-fetch works
Main Components
a) Core Components:
• DrFetch Class (Central Component)
• Body Parser System
• Header Management System
• Custom Fetch Function Handler
b) Integration Points:
• Native Fetch API Integration
• Custom Fetch Function Interface
• Response Type System
Top Layer (Client Usage):
• Application Code
• Type Definitions (<T, R>)
Middle Layer (dr-fetch Core):
• DrFetch Class
• Type System
• Parser Registry
• HTTP Method Shortcuts
• Header Management
• setHeaders
• makeIterableHeaders
Bottom Layer (Runtime):
• Custom Fetch Function (Optional)
• Native Fetch API
Key Relationships to Highlight
a) Type Flow:
• How type information flows from client code through the DrFetch class
• Relationship between status codes and response types
b) Data Flow:
• Request flow from client through DrFetch to fetch implementation
• Response flow back through parsers to typed responses
Important Details
• Parser Registry System showing how content-type maps to parser functions
• Header Management System showing the various input formats supported
• Type System showing the relationship between HTTP status codes and response types
• HTTP Method Shortcuts (get, post, put, etc.)