Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://tmenier.github.io/Flurl
Fluent URL builder and testable HTTP client for .NET
https://tmenier.github.io/Flurl
c-sharp dotnet http rest-client url-builder
Last synced: about 13 hours ago
JSON representation
Fluent URL builder and testable HTTP client for .NET
- Host: GitHub
- URL: https://tmenier.github.io/Flurl
- Owner: tmenier
- License: mit
- Created: 2014-02-16T23:43:15.000Z (almost 11 years ago)
- Default Branch: dev
- Last Pushed: 2025-01-01T23:14:30.000Z (about 1 month ago)
- Last Synced: 2025-01-29T01:09:08.610Z (6 days ago)
- Topics: c-sharp, dotnet, http, rest-client, url-builder
- Language: C#
- Homepage: https://flurl.dev
- Size: 5.3 MB
- Stars: 4,256
- Watchers: 101
- Forks: 392
- Open Issues: 54
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-dotnet - Flurl.Http - Fluent, portable, testable REST/HTTP client library (HTTP)
- system-architecture-awesome - Flurl.Http - Fluent, portable, testable REST/HTTP client library (HTTP)
README
# Flurl
[![build](https://github.com/tmenier/Flurl/actions/workflows/ci.yml/badge.svg)](https://github.com/tmenier/Flurl/actions/workflows/ci.yml)
[![NuGet Version](http://img.shields.io/nuget/v/Flurl.Http.svg?style=flat)](https://www.nuget.org/packages/Flurl.Http/)
[![NuGet Downloads](https://img.shields.io/nuget/dt/Flurl.Http.svg)](https://www.nuget.org/packages/Flurl.Http/)Flurl is a modern, fluent, asynchronous, testable, portable, buzzword-laden URL builder and HTTP client library.
```cs
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();[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](https://twitter.com/intent/user?screen_name=FlurlHttp).
For detailed documentation, please visit the [main site](https://flurl.dev).