Migration Guides
Moving to CurlDotNet from another HTTP client? These guides will help you migrate your existing code with minimal effort.
Available Migration Guides
Migrating from HttpClient
Learn how to replace System.Net.Http.HttpClient with CurlDotNet, including:
- Basic request patterns
- Header management
- Content types
- Error handling
- Performance considerations
Migrating from RestSharp
Transition from RestSharp to CurlDotNet with:
- Request building patterns
- Serialization/deserialization
- Authentication methods
- Interceptors and middleware
- Testing strategies
Why Migrate to CurlDotNet?
From HttpClient
- Better error messages: CurlDotNet provides detailed error information
- Simpler API: Less ceremony, more productivity
- curl compatibility: Leverage curl’s proven reliability
- Consistent behavior: Same results across all platforms
From RestSharp
- Pure C#: No native dependencies
- Modern async: Built for async/await from the ground up
- Lighter weight: Smaller package, fewer dependencies
- Active maintenance: Regular updates and improvements
Quick Comparison
HttpClient
// HttpClient
using var client = new HttpClient();
var response = await client.GetAsync("https://api.example.com/data");
var content = await response.Content.ReadAsStringAsync();
// CurlDotNet
var curl = new Curl();
var result = await curl.GetAsync("https://api.example.com/data");
var content = result.Data;
RestSharp
// RestSharp
var client = new RestClient("https://api.example.com");
var request = new RestRequest("data", Method.GET);
var response = await client.ExecuteAsync(request);
// CurlDotNet
var curl = new Curl();
var result = await curl.GetAsync("https://api.example.com/data");
Migration Tools
We provide helpers to make migration easier:
- Extension methods: HttpClient-like APIs for easier transition
- Compatibility layer: Drop-in replacements for common patterns
- Migration analyzer: Identify code that needs updating
Getting Started
- Choose your migration guide based on your current client
- Review the key differences and benefits
- Follow the step-by-step migration examples
- Test your migrated code thoroughly
- Enjoy the simplicity and reliability of CurlDotNet!
Need Help?
- GitHub Issues - Ask questions or report problems
- Examples - See working code
- API Documentation - Detailed API reference