Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 2 months 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 (almost 11 years ago)
- Default Branch: dev
- Last Pushed: 2024-10-16T20:24:07.000Z (about 2 months ago)
- Last Synced: 2024-10-18T19:43:10.816Z (about 2 months ago)
- Topics: c-sharp, dotnet, http, rest-client, url-builder
- Language: C#
- Homepage: https://flurl.dev
- Size: 5.44 MB
- Stars: 4,199
- Watchers: 101
- Forks: 388
- Open Issues: 52
-
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
[![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).