Need help with Flurl?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

tmenier
2.5K Stars 251 Forks MIT License 757 Commits 53 Opened issues

Description

Fluent URL builder and testable HTTP client for .NET

Services available

!
?

Need anything else?

Contributors list

Flurl

Build status Flurl-stable Flurl.Http-stable Flurl-pre-release Flurl.Http-pre-release

Flurl is a modern, fluent, asynchronous, testable, portable, buzzword-laden URL builder and HTTP client library.

var result = await "https://api.mysite.com"
    .AppendPathSegment("person")
    .SetQueryParams(new { api_key = "xyz" })
    .WithOAuthBearerToken("my_oauth_token")
    .PostJsonAsync(new { first_name = firstName, last_name = lastName })
    .ReceiveJson();

[Test] public void Can_Create_Person() { // fake & record all http calls in the test subject using (var httpTest = new HttpTest()) { // arrange httpTest.RespondWith("OK", 200);

    // act
    await sut.CreatePersonAsync("Claire", "Underwood");

    // assert
    httpTest.ShouldHaveCalled("http://api.mysite.com/*")
        .WithVerb(HttpMethod.Post)
        .WithContentType("application/json");
}

}

Get it on NuGet:

PM> Install-Package Flurl.Http

Or get just the stand-alone URL builder without the HTTP features:

PM> Install-Package Flurl

For updates and announcements, follow @FlurlHttp on Twitter.

For detailed documentation, please visit the main site.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.