Go to file
Todd 20e0b4ba9c version bump 2022-06-20 07:15:38 -05:00
.github/ISSUE_TEMPLATE Update issue templates 2019-01-11 08:33:33 -06:00
Build re-naming Flurl.Http.CodeGen -> Flurl.CodeGen 2020-10-24 13:30:12 -05:00
Test/Flurl.Test #703 drop ConnectionLeaseTimeout 2022-06-10 14:30:13 -05:00
src version bump 2022-06-20 07:15:38 -05:00
.editorconfig adding EditorConfig with code conventions 2019-04-26 12:51:14 -05:00
.gitattributes This closes #61 2016-04-06 00:40:58 +03:00
.gitignore Enable snupkg symbol packages 2021-05-10 10:31:14 +12:00
Flurl.sln target framework updates 2022-05-27 12:58:26 -05:00
LICENSE Happy belated new year 2022-01-22 11:29:36 -06:00
NuGet.Config [edit] migrate to VS2017 2017-06-05 22:32:36 +03:00
README.md Label Build Badges, Include Prerelease Badges 👮 2020-03-24 22:29:26 -05:00
appveyor.yml AppVeyor image upgrade for .NET 6 2022-06-05 12:16:50 -05:00
icon.png embedded package icon & version bump 2019-12-29 10:10:58 -06:00

README.md

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.