π Big News: CurlDotNet v1.0.0 is Now on NuGet!
With full support for C#, F#, VB.NET,.NET 10 and .NET Framework
Hey DEV community! I'm thrilled to announce that CurlDotNet is officially live on NuGet! After months of development and testing, you can now install it with a single command:
dotnet add package CurlDotNet
The Problem We All Face
Picture this: You're building a .NET app and find the perfect API example... but it's a curl command:
curl -X POST https://api.stripe.com/v1/charges \
-u sk_test_123: \
-d amount=2000 \
-d currency=usd \
-d source=tok_visa
Now you have to:
- π€ Figure out the HttpClient equivalent
- π Rewrite everything in C#
- π Debug the differences
- π€ Waste 30 minutes on something that should take 30 seconds
Enter CurlDotNet: Just Paste and Go!
With CurlDotNet, you literally paste the curl command into your C# code:
using CurlDotNet;
// Just paste it!
var result = await Curl.ExecuteAsync(@"
curl -X POST https://api.stripe.com/v1/charges \
-u sk_test_123: \
-d amount=2000 \
-d currency=usd \
-d source=tok_visa
");
Console.WriteLine(result.Body); // Your charge is created!
That's it. No translation. No googling. It just works.
π₯ Real-World Examples That Just Work
GitHub API
// From GitHub's docs - paste directly!
var result = await Curl.ExecuteAsync(@"
curl -H 'Accept: application/vnd.github+json' \
-H 'Authorization: Bearer ghp_YOUR_TOKEN' \
https://api.github.com/user/repos
");
var repos = JsonSerializer.Deserialize<List<Repo>>(result.Body);
OpenAI API
// From OpenAI docs - no translation needed!
var result = await Curl.ExecuteAsync(@"
curl https://api.openai.com/v1/chat/completions \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer $OPENAI_API_KEY' \
-d '{
""model"": ""gpt-4"",
""messages"": [{""role"": ""user"", ""content"": ""Hello!""}]
}'
");
File Downloads
// Download with progress - curl style!
var result = await Curl.ExecuteAsync(@"
curl -L -o output.zip \
--progress-bar \
https://github.com/repo/archive/main.zip
");
π οΈ Three Ways to Use CurlDotNet
1. Command Mode (Paste from docs)
var result = await Curl.ExecuteAsync("curl https://api.example.com");
2. Fluent Builder (Type-safe with IntelliSense)
var result = await Curl.Request("https://api.example.com")
.WithMethod("POST")
.WithHeader("Authorization", "Bearer token")
.WithData("{\"key\":\"value\"}")
.ExecuteAsync();
3. LibCurl API (Reusable client)
using var curl = new LibCurl();
curl.WithBearerToken("token123")
.WithTimeout(TimeSpan.FromSeconds(30));
var users = await curl.GetAsync("https://api.example.com/users");
var posts = await curl.GetAsync("https://api.example.com/posts");
π― Why CurlDotNet is Different
This is NOT a wrapper around the curl binary. It's a complete reimplementation in pure C#:
- β No dependencies - Pure .NET, no native binaries
- β Cross-platform - Windows, Linux, macOS, Docker, everywhere
- β .NET 10 Ready - Tested on .NET 6, 8, and 10
- β Universal - .NET Standard 2.0 means it works with Framework, Xamarin, Unity, MAUI
- β 93% Test Coverage - 223 tests passing
- β IntelliSense - Full IDE support
π By the Numbers
- 240 unit tests (223 passing - 93% coverage)
- 100% curl syntax compatibility for HTTP/HTTPS
- Zero external dependencies
- 3 API styles to match your coding preference
- Supports .NET Standard 2.0+ (Framework 4.7.2 to .NET 10)
π What's Next?
CurlDotNet is part of the UserlandDotNet initiative - bringing Linux userland tools to .NET. Coming soon:
-
grepfor .NET -
sedandawkfor text processing -
tarfor archives - PowerShell cmdlets for everything
π‘ Try It Now!
- Install the package:
dotnet add package CurlDotNet
- Paste any curl command:
var result = await Curl.ExecuteAsync("curl https://httpbin.org/json");
Console.WriteLine(result.Body);
- That's it! You're using curl in C#!
π€ Get Involved
CurlDotNet is open source and needs your help!
- β Star the repo: github.com/jacob-mellor/curl-dot-net
- π Report issues: Found a bug? Let me know!
- π» Contribute: PRs welcome for new features
- π’ Share: Tell your team about CurlDotNet
π Special Thanks
Built with passion by Jacob Mellor at IronSoftware, inspired by the .NET community's need for better tools.
Questions?
Drop a comment below! I'm here to help and would love to hear how you're using CurlDotNet.
Install now and stop translating curl commands forever:
dotnet add package CurlDotNet
NuGet: nuget.org/packages/CurlDotNet
GitHub: github.com/jacob-mellor/curl-dot-net
Top comments (0)