Skip to content
Fluent URL builder and testable HTTP client for .NET
Branch: dev
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/ISSUE_TEMPLATE
Build [edit] add test exclude to test.cmd Feb 24, 2019
PackageTesters updated package testers for Flurl.Http 2.4 (plus new csproj format fo… Sep 5, 2018
Test/Flurl.Test sigh...2 seconds is still not long enough Mar 21, 2019
src
.gitattributes This closes #61 Apr 5, 2016
.gitignore
Flurl.sln troubleshoot test that's failing only on AppVeyor Mar 21, 2019
LICENSE Update LICENSE Jun 13, 2018
NuGet.Config
README.md Claire > Frank Jun 25, 2018
appveyor.yml [revent] appv CI Jul 17, 2017

README.md

Flurl

Build status Flurl Flurl.Http

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(200, "OK");

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

You can’t perform that action at this time.