Skip to content

DNF-SaS/Flurl

This branch is 638 commits behind tmenier/Flurl:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

d2cde56 · Feb 27, 2017
Feb 27, 2017
Feb 27, 2017
Feb 27, 2017
Feb 27, 2017
Apr 5, 2016
Jun 30, 2016
Feb 3, 2017
Feb 16, 2014
Jul 18, 2016
Feb 26, 2017
Nov 24, 2016
Sep 14, 2016

Repository files navigation

#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("Frank", "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 for .NET

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 99.4%
  • Batchfile 0.6%