maui-rest-api

Configure a reusable HttpClient service for REST API CRUD operations in .NET MAUI apps.

Updated Apr 21, 2026
One-click install
npx skills add https://github.com/snailb1007/snail-codex-skills --skill maui-rest-api-snailb1007
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: maui-rest-api
Source: https://github.com/snailb1007/snail-codex-skills/tree/main/skills/maui-rest-api
Command: npx skills add https://github.com/snailb1007/snail-codex-skills --skill maui-rest-api-snailb1007

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Simplifies integration with REST services in .NET MAUI by providing a reusable HttpClient-based pattern, DI wiring, and consistent JSON handling for all API calls.

Core Features & Use Cases

  • Reusable HttpClient pattern: centralizes configuration and lifetime management.
  • CRUD operations pattern: defines Get, Create, Update, Delete across resources.
  • Platform-aware networking: includes guidance for Android/iOS clear-text traffic and error handling.

Quick Start

Configure a shared HttpClient in DI, register an IApiService implementation, and begin calling CRUD methods against your REST API.

Frequently Asked Questions about maui-rest-api

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I consume a REST API in .NET MAUI using HttpClient and dependency injection?

To consume a REST API in .NET MAUI, configure a shared HttpClient with a BaseAddress, register an API service interface via dependency injection, and use JsonSerializerOptions for camelCase deserialization. This pattern centralizes configuration and lifetime management for all API calls.

What is the best way to handle CRUD operations and JSON deserialization in MAUI apps?

The best way to handle CRUD operations in MAUI apps is defining a reusable service interface for Get, Create, Update, and Delete methods. Consistent JSON handling is achieved by setting JsonSerializerOptions to camelCase to ensure proper deserialization of API responses.

How do I configure clear-text traffic for Android and iOS in a .NET MAUI app?

Configuring clear-text traffic for Android and iOS in a .NET MAUI app requires platform-specific networking settings. This Skill provides guidance on adjusting these configurations to allow HTTP connections and ensure robust error handling across mobile platforms.

Does this REST API pattern for MAUI require a specific HttpClient lifetime configuration?

The REST API pattern for MAUI requires a shared HttpClient configured with a BaseAddress and registered through dependency injection. This approach centralizes lifetime management, ensuring the HttpClient is reused properly across common mobile and desktop scenarios.

Why do I need to set JsonSerializerOptions for camelCase when calling REST APIs in MAUI?

You need to set JsonSerializerOptions for camelCase when calling REST APIs in MAUI to ensure consistent JSON deserialization. This configuration aligns the JSON parsing behavior with standard REST API response formats, preventing data mapping errors.