# Flurl **Repository Path**: dotnetkits/Flurl ## Basic Information - **Project Name**: Flurl - **Description**: Flurl是一个集现代性、流畅性、异步性、可测试性、可移植性于一身的URL构建器与HTTP客户端库。它提供了简洁的API,使得HTTP请求的发送与URL的构建变得极为简单与直观。无论是构建复杂的URL路径,还是设置查询参数、请求头或认证信息,Flurl都能以几乎零学习成本的方式实现。 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: dev - **Homepage**: https://flurl.dev/ - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 3 - **Created**: 2024-12-31 - **Last Updated**: 2024-12-31 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## 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).