Skip to content
/ Flurl Public
forked from tmenier/Flurl

Fluent URL builder and testable HTTP client for .NET

License

Notifications You must be signed in to change notification settings

kkd83/Flurl

This branch is 1 commit ahead of, 167 commits behind tmenier/Flurl:dev.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

eb0c043 Â· Feb 15, 2022
Jan 11, 2019
Oct 24, 2020
Jan 22, 2022
Feb 15, 2022
Feb 15, 2022
Apr 26, 2019
Apr 5, 2016
Mar 21, 2019
Oct 24, 2020
Jan 22, 2022
Jun 5, 2017
Mar 25, 2020
Aug 9, 2020
Dec 29, 2019

Repository files navigation

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<T>();

[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.

About

Fluent URL builder and testable HTTP client for .NET

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 99.5%
  • Other 0.5%