https://github.com/tmenier/Flurl
Fluent URL builder and testable HTTP client for .NET
https://github.com/tmenier/Flurl
c-sharp dotnet http rest-client url-builder
Last synced: about 1 month ago
JSON representation
Fluent URL builder and testable HTTP client for .NET
- Host: GitHub
- URL: https://github.com/tmenier/Flurl
- Owner: tmenier
- License: mit
- Created: 2014-02-16T23:43:15.000Z (about 11 years ago)
- Default Branch: dev
- Last Pushed: 2025-01-01T23:14:30.000Z (4 months ago)
- Last Synced: 2025-03-12T07:06:21.182Z (about 1 month ago)
- Topics: c-sharp, dotnet, http, rest-client, url-builder
- Language: C#
- Homepage: https://flurl.dev
- Size: 5.3 MB
- Stars: 4,281
- Watchers: 99
- Forks: 391
- Open Issues: 56
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome - tmenier/Flurl - Fluent URL builder and testable HTTP client for .NET (C\#)
- awesome-dotnet-core - Flurl - Fluent URL builder and testable HTTP for .NET [https://flurl.dev](https://flurl.dev). (Frameworks, Libraries and Tools / API)
- awesome-reference-tools - Flurl
- fucking-awesome-dotnet-core - Flurl - Fluent URL builder and testable HTTP for .NET 🌎 [https://flurl.dev](flurl.dev). (Frameworks, Libraries and Tools / API)
- awesome-xamarin - Flurl ★1,295 - Flurl is a modern, fluent, asynchronous, testable, portable, buzzword-laden URL builder and HTTP client library. (Network)
- awesome-dotnet-core - Flurl - Fluent URL builder and testable HTTP for .NET [https://flurl.dev](https://flurl.dev). (Frameworks, Libraries and Tools / API)
- awesome-dotnet-core-cn - Flurl - Fluent是支持异步链式HTTP请求类库。 [https://flurl.io](https://flurl.io). (算法与数据结构 / API)
- awesome-dotnet-core - Flurl - 适用于.NET的Fluent URL构建器和可测试的HTTP。 (框架, 库和工具 / API)
README
# Flurl
[](https://github.com/tmenier/Flurl/actions/workflows/ci.yml)
[](https://www.nuget.org/packages/Flurl.Http/)
[](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).