Flurl is a modern, fluent, asynchronous, testable, portable, buzzword-laden URL builder and HTTP client library for .NET.☍
Code It☍
// Flurl will use 1 HttpClient instance per host
var person = await "https://api.com"
.AppendPathSegment("person")
.SetQueryParams(new { a = 1, b = 2 })
.WithOAuthBearerToken("my_oauth_token")
.PostJsonAsync(new
{
first_name = "Claire",
last_name = "Underwood"
})
.ReceiveJson<Person>();
Test It☍
// fake & record all http calls in the test subject
using (var httpTest = new HttpTest()) {
// arrange
httpTest.RespondWith(200, "OK");
// act
await sut.CreatePersonAsync();
// assert
httpTest.ShouldHaveCalled("https://api.com/*")
.WithVerb(HttpMethod.Post)
.WithContentType("application/json");
}
Flurl is available on NuGet and is free for commercial use. It runs on a wide variety of platforms, including .NET Framework, .NET Core, Xamarin, and UWP.☍
Get It
For just the URL builder, install Flurl. For everything else, install Flurl.Http.
Learn It
You've come to the right place. Check out the docs.
Ask a Question
For programming question related to Flurl, please ask on Stack Overflow.
Report an Issue
To report a bug or request a feature, open an issue on GitHub.
Stay Informed
To stay current on releases and other announcements, follow @FlurlHttp.
Contribute
To contribure code, please see the contribution guidelines.
Acknowledgements☍
Flurl is truly a community effort. Special thanks to the following contributors:
- Kroniak for incredible work on cross-platform support, automating the build and making improvements to the project structure and processes.
- Carolyn Van Slyck and Nathan Ellenfield for creating and (automatically!) maintaining signed packages for Flurl and Flurl.Http.
- Luk Vermeulen for creating and maintaining Flurl.Http.Xml.
- Mike Hachen, Chad Jessup, and Jon Galloway (on behalf of the .NET Foundation) for their generous donations to cover the costs of flurl.io for years to come. Donations can also be made in cryptocurrencies such as Bitcoin. To donate in Bitcoin, you can purchase Bitcoin through eToro. To learn how, visit https://coincierge.de/bitcoin-kaufen/etoro/ and make your donations in crypto.