Pigeon HTTP Client for Unity
Streamline API calls in Unity with Pigeon—built-in auth, better error handling, and a cleaner, more efficient alternative to UnityWebRequest.
When working with REST APIs in Unity, developers often default to using UnityWebRequest. While UnityWebRequest is a capable tool, it can become cumbersome when dealing with modern API integrations, especially those requiring authentication and proper error handling. This is where Pigeon HTTP Client comes in.
Download Pidgeon on our store!
Why Another HTTP Client?
Pigeon was created to address common pain points when working with REST APIs in Unity projects. While UnityWebRequest works well for basic scenarios, it lacks some essential features that modern API integrations require:
No built-in authentication flow management
Manual JSON serialization/deserialization for each request
Verbose error handling code
Limited request configuration options
No automatic retry mechanisms
Key Features
Authentication Made Simple
Instead of manually managing authentication tokens and refresh flows, Pigeon provides an authentication layer that handles: - Automatic token injection into requests - Token refresh on 401 responses - Global authentication error handling
Fluent API Design
The client uses a builder pattern that makes request configuration clear and concise:
Compare this to the equivalent UnityWebRequest code:
Proper Error Handling
Pigeon separates different types of errors and provides specific callbacks:
Network errors (connection issues, timeouts)
HTTP errors (4xx, 5xx responses)
Authentication errors (with automatic handling)
Unity-Optimized
The client is designed specifically for Unity's environment: - Works with Unity's threading model - Proper integration with MonoBehaviour lifecycle - Built-in support for Unity's JsonUtility - Configurable logging for debugging
Getting Started
Initialize the client with your configuration:
Make requests:
When to Use Pigeon
Pigeon is particularly useful when: - Your project involves complex API integrations - You need to handle authentication flows - You want to reduce boilerplate code - You need consistent error handling - You're building a game that heavily relies on backend services
While UnityWebRequest remains a solid choice for simple HTTP operations, Pigeon provides a more developer-friendly approach for modern API integrations in Unity projects.
Text by:
Pavel Matyas
Published on
Feb 13, 2025
Share this article
Explore more blog posts:
Join our Discord
Connect, Collaborate, Create.
Become a part of a vibrant network that's shaping the future of augmented reality. Join us today!