2016-11-20 19:19:23 -06:00
2016-11-20 19:19:23 -06:00
2016-09-14 17:29:39 +03:00
2016-11-20 19:19:23 -06:00
2016-04-06 00:40:58 +03:00
2016-06-30 14:40:06 +03:00
2016-09-20 14:42:11 +03:00
2016-09-14 17:29:39 +03:00
2014-02-16 15:43:15 -08:00
2016-07-26 21:03:18 +03:00

#Flurl

Build status NuGet MyGet PreRelease

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%