What problem does it solve?
This Skill documents best practices and common gotchas for consuming REST APIs from .NET MAUI applications, helping prevent socket exhaustion, UI deadlocks, incorrect JSON deserialization, and platform-specific networking failures.
Core Features & Use Cases
- HttpClient lifecycle management: guidance to register HttpClient as a singleton or use IHttpClientFactory to avoid socket exhaustion.
- Async and error handling: use async/await correctly, check status codes before deserializing, and catch HttpRequestException and JsonException.
- Serialization and DI patterns: configure JsonSerializerOptions with camelCase and register API services via interfaces for testability and separation of concerns.
- Full CRUD and platform notes: patterns for GET/POST/PUT/DELETE, emulator loopback addresses (Android 10.0.2.2 vs iOS localhost), and clear-text HTTP configuration for local development.
Quick Start
Register a singleton HttpClient and your API service in DI, configure JsonSerializerOptions with camelCase, and call the provided async CRUD methods while handling HttpRequestException and JsonException.