登录 注册
开发者工具
9,811
Stars
2,295
Forks
408
Watchers
31
Open Issues
Apache-2.0
许可证
C#
语言
2009-11-16
创建时间
2026-11-09
最近更新

项目能做什么

适用于 .NET 的简单易用 REST 和 HTTP API 客户端库。
来源:AI 基于仓库事实生成 · 内容以仓库实际 README 为准

使用说明 查看原始 README 原仓库文档

中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
# RestSharp - Simple .NET REST Client 

![](https://img.shields.io/nuget/dt/RestSharp) [![](https://img.shields.io/nuget/v/RestSharp)](https://www.nuget.org/packages/RestSharp) [![](https://img.shields.io/nuget/vpre/RestSharp)](https://www.nuget.org/packages/RestSharp#versions-body-tab)

RestSharp is a lightweight HTTP API client library. It's a wrapper around `HttpClient`, not a full-fledged client on 
its own.

What RestSharp adds to `HttpClient`:
- Default parameters of any kind, not just headers
- Add a parameter of any kind to requests, like query, URL segment, header, cookie, or body
- Multiple ways to add a request body, including JSON, XML, URL-encoded form data, multipart form data with and 
  without files
- Built-in serialization and deserilization of JSON, XML, and CSV, as well as the ability to add custom serializers
- Rich support for authentication

## Compatibility note

RestSharp 107 was a major release that brings a lot of changes. We've removed a lot of legacy code and added new 
features. Finally, RestSharp has moved to `HttpClient`. We also deprecated the following:
- SimpleJson in favour of `System.Text.Json.JsonSerialzer`
- `IRestRequest`, and `IRestResponse` in favour of implementing classes
- Everything `Http` and `IHttp` as those are just wrappers
- Client configuration moved to `RestClientOptions` to make the client thread-safe
- `IRestClient` interface surface substantially reduced

Most of the client and some of the request options are now in `RestClientOptions`.

Check [v107+ docs](https://restsharp.dev/v107) for more information.

## Packages

| Package                                | What it's for                                                                        |
|----------------------------------------|--------------------------------------------------------------------------------------|
| `RestSharp`                            | The core library, including `System.Text.Json` serializer and basical XML serializer |
| `RestSharp.Serializers.NewtonsoftJson` | Use `Newtonsoft.Json` as a JSON serializer                                           |
| `RestSharp.Serializers.Xml`            | Use custom RestSharp XML serializer for XML                                          |
| `RestSharp.Serializers.CsvHelper`      | Use `CsvHelper` as a CSV serializer                                                  |

## Code of Conduct

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community.
For more information see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).

**Users violated the aforementioned code of conduct will be blocked.**

## Support

RestSharp is an open-source project with a single maintainer. Do not expect your issue to be resolved unless it concerns a large group of RestSharp users.
The best way to resolve your issue is to fix it yourself. Fork the repository and submit a pull request.
You can also mo
阅读完整原文

项目深度分析 AI 生成

RestSharp 企业专属支持与遗留版本升级迁移服务

产品构想针对企业从 RestSharp 早期老版本(如v106及以下版本)向 v107+ 现代 HttpClient 架构迁移的技术断层,提供迁移评估工具、咨询及商业级 SLA 支持。
核心功能遗留代码迁移自动化脚本/分析器、破坏性变更兼容适配层、专属问题排查通道与关键补丁快速响应协议。
目标用户维护大型.NET老旧系统、有升级或合规需求的企业开发团队。
难度/周期中等 · 2-4周 · 成本:极低(主要为人力时间成本)
收费模式按企业席位/系统规模收取一次性迁移咨询费,或按年收取企业级维护保障费。
竞争风险企业客户采购周期长,单纯的开源支持服务难以形成大规模订阅收入。
依据 已验证事实

基于 OpenAPI/Swagger 的 RestSharp 强类型代码生成工具 (CLI/VS扩展)

产品构想开发一个轻量级 CLI 工具或 Visual Studio 插件,能够根据 OpenAPI/Swagger 文档自动生成符合 RestSharp 最新规范的强类型客户端模型与调用代码。
核心功能Swagger/OpenAPI 到 RestSharp 代码生成、自动化重试策略与拦截器注入、内置 mock 与单元测试桩生成。
目标用户频繁对接第三方 REST API 的 .NET 工程师及外包团队。
难度/周期中等 · 1-2个月 · 成本:低(主要为工具开发与上架维护)
收费模式基础生成功能免费开源,高级功能(企业级认证模版、专属 VS 插件界面、自动化 CI/CD 集成)采用订阅制或买断 License。
竞争风险市场上存在通用的 OpenAPI 客户端生成器(如 NSwag、OpenAPI Generator),需要突出 RestSharp 本地化优化和易用性以获取竞争壁垒。
依据 数据支持的判断

RestSharp 运行时遥测与 API 流量监控诊断扩展组件

产品构想为 RestSharp 构建即插即用的商业监控中间件包,无缝打通 OpenTelemetry,提供 API 调用耗时、异常重试跟踪、敏感数据脱敏与故障诊断仪表盘。
核心功能开箱即用的 RestSharp 拦截器探针、分布式链路追踪关联、API 调用成本与配额告警分析面板、多环境调用异常自动捕获。
目标用户需要对微服务外部调用进行深入可观测性监控的 .NET 架构师及 SRE。
难度/周期高 · 2-3个月 · 成本:中等(需维护遥测后台及部分云资源)
收费模式SaaS订阅(按每月监控 API 追踪事件量计费)或专有环境部署授权费。
竞争风险面临通用 APM 厂商(如 Datadog、Dynatrace、New Relic)的泛化竞争,必须聚焦于 API 级精细治理与深度上下文排错。
依据 尚需验证的假设
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心

竞品与相似项目 GitHub Search 真实检索

项目中文简介Stars语言
FubarDevelopment/restsharp.portable 中文介绍暂未生成
Some kind of a RestSharp port to PCL
94 C#
adamfisher/RestSharp.Serializers.Newtonsoft.Json 中文介绍暂未生成
Restores Newtonsoft.JSON as the default serializer for RestS
41 C#
rahulrathore44/RestSharpFramework 中文介绍暂未生成
Framework for testing RESTful Services with RestSharp and C#
34 C#
以上为通过 GitHub 官方 Search API 检索的相似项目,功能差异与优劣势需进一步人工确认,配置 AI 后可生成对比分析。

项目优势与风险

技术成熟度创建于 2009-11-16,近 30 天仍在推送,发布过 57 个 Release
社区活跃Star 9,811 / Fork 2,295 / Issue 31(数据支持,可自行核实)
许可证Apache-2.0
主要风险上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价

安装与使用

此项目未提供 Docker 镜像,安装步骤以原仓库 README 为准(涉及依赖安装与环境配置,对新手门槛较高)。