2016-07-17 21:18:47 -05:00
2016-07-17 21:18:47 -05:00
2016-07-17 21:18:47 -05:00
2016-04-06 00:40:58 +03:00
2016-06-30 14:40:06 +03:00
2016-06-29 22:20:20 +03:00
2014-02-16 15:43:15 -08:00
2016-05-20 16:46:15 +03:00
2016-07-06 17:43:19 +03:00

#Flurl

Build
status NuGet MyGet 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(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.

Description
No description provided
Readme 5.6 MiB
Languages
C# 99.5%
Shell 0.3%
Batchfile 0.2%