Flurl.Http 4.0.2

Flurl

build NuGet Version NuGet Downloads

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("Frank", "Reynolds");
        
    // 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.

Showing the top 20 packages that depend on Flurl.Http.

Packages Downloads
SKIT.FlurlHttpClient.Common
SKIT.FlurlHttpClient 系列开发工具包的公共组件。
32
SKIT.FlurlHttpClient.Common
SKIT.FlurlHttpClient 系列开发工具包的公共组件。完整组件请见 https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient
9

https://github.com/tmenier/Flurl/releases

.NET Framework 4.6.1

.NET 6.0

.NET Standard 2.0

Version Downloads Last updated
4.0.2 33 12/07/2024