# HttpAgent **Repository Path**: uopenRYP/HttpAgent ## Basic Information - **Project Name**: HttpAgent - **Description**: HttpAgent 是一个高性能、灵活且易用的开源库,提供了全面的 HTTP 功能支持,包括文件传输、轮询、测试工具、实时通信、请求管理、Media 类型处理、MessagePack 支持、声明式请求等。 内置工业级报文透视引擎(Profiler),彻底终结第三方 API 对接的“黑匣子”时代,并具有低资源消耗和高测试覆盖率的特点。 - **Primary Language**: C# - **License**: MIT - **Default Branch**: master - **Homepage**: https://http.furion.net - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 45 - **Created**: 2026-08-21 - **Last Updated**: 2026-08-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # HttpAgent [![license](https://img.shields.io/badge/license-MIT-orange?cacheSeconds=10800)](https://gitee.com/dotnetchina/HttpAgent/blob/master/LICENSE) [![nuget](https://img.shields.io/nuget/v/HttpAgent.svg?cacheSeconds=10800)](https://www.nuget.org/packages/HttpAgent) [![dotNET China](https://img.shields.io/badge/organization-dotNET%20China-yellow?cacheSeconds=10800)](https://gitee.com/dotnetchina) HttpAgent is a high-performance, flexible, and user-friendly open-source library that provides comprehensive support for HTTP functionalities, including file transfer, polling, testing tools, real-time communication, request management, media type handling, MessagePack support, Declarative Requests, and more. **It features a built-in industrial-grade HTTP traffic inspection engine (Profiler) that completely eliminates the "black box" dilemma in third-party API integration**, and is characterized by low resource consumption and high test coverage. ![HttpAgent.drawio](https://gitee.com/dotnetchina/HttpAgent/raw/master/drawio/HttpAgent.drawio.jpg "HttpAgent.drawio.jpg") [**View High-Definition Architecture Diagram**](https://gitee.com/dotnetchina/HttpAgent/blob/master/drawio/HttpAgent.drawio) ## Features - **Comprehensive `HTTP` Method Support**: Covers `GET`, `POST`, `PUT`, `DELETE`, `PATCH`, `HEAD`, `TRACE`, `OPTIONS` and `QUERY` methods. - **Industrial-Grade HTTP Traffic Inspection Engine (`Profiler`)**: Completely eliminates the "black box" pain points in third-party API integration, allowing you to inspect underlying HTTP traffic directly in the console without relying on external packet capture tools like Fiddler or Wireshark. - **File Transfer Functionality**: Supports file upload and download with real-time transfer progress monitoring. - **Polling Mechanism**: Supports standard polling and long polling with customizable polling intervals. - **Testing Toolkit**: Capable of stress testing, performance testing, and simulation testing with the ability to generate detailed test reports; supports configuration of the number of requests, concurrency levels, and test iteration counts. - **`HTTP` Proxy and Microservice Integration**: Supports `HTTP` proxy and request forwarding, suitable for integration development in microservice architectures. - **Real-Time Communication Capability**: Implements real-time data push via `Server-Sent Events (SSE)` and is compatible with `WebSocket` protocol. - **Request Management and Log Auditing**: Includes built-in request interception mechanisms and `HTTP` request log auditing functions. - **Request Resilience & Fault Tolerance**: Built-in retry mechanism (triggered by status codes/exceptions, with exponential backoff) and timeout control; extensible to circuit breaker, fallback, and other advanced resilience patterns. - **Automatic `Access Token` Management**: Built-in automatic `Access Token` refresh and injection mechanism, supports custom `Token` providers and configurators, automatically attaches `Token` to requests, and retries automatically on `401` responses. - **API Call Quota Limitation**: Supports daily, weekly, monthly, and lifetime window strategies, with customizable quota strategies; immediately aborts requests when limits are exceeded, preventing abuse of third-party APIs. - **`ETag` Response Caching**: Automatically caches responses with `ETag`, and reuses cached responses when the server returns `304 Not Modified`, reducing data transfer. - **Media Type Handling**: Provides predefined handling mechanisms for mainstream `MediaTypes` and offers an open interface for custom handling. - **`MessagePack` Support**: Integrates `MessagePack` serialization and deserialization capabilities to enhance data exchange efficiency. - **`WebService` Support**: Comprehensive support for `SOAP` and `RESTful WebService`, including automatic client proxy generation, `WSDL` parsing, `XML/JSON` data binding, simplifying integration and interaction. - **`OData` Support**: Built-in `OData` client with support for standard query options including `$filter`, `$select`, and `$expand`, streamlining `OData` service integration. - **`cURL` Command Parsing**: Initiate HTTP requests directly from native `cURL` command strings, covering common options and freely extensible with custom flags. - **Declarative Requests**: Specifying the behavior of requests through simple attribute annotations or interface definitions. - **Flexible Response Transformation**: Provides common `HTTP` response transformers and supports custom transformation logic. - **High Performance and Resource Management**: Employs memory optimization techniques and connection pool management to ensure low resource consumption and high performance. - **Response Automatic Decompression**: Built-in support for `gzip`, `deflate`, `brotli` and `zstd` automatic decompression of response content, reducing manual handling and saving bandwidth. - **Architecture Design**: Flexible architecture design that is easy to use and extend. - **Cross-Platform Independence**: Supports cross-platform operation without external dependencies. - **Application Type Support**: Supports any application type, including but not limited to Console, Web, WebAssembly, WinForms, WPF, MAUI. - **High-Quality Code Assurance**: Adheres to high-standard coding practices, with unit and integration test coverage as high as `98%`. - **`.NET 8+` Compatibility**: Can be deployed and used in environments running `.NET 8` and higher versions. ## Installation ```powershell dotnet add package HttpAgent ``` ## Getting Started We have many examples on our [homepage](https://http.furion.net/). Here's your first one to get you started: 1. Register `HttpRemote` service: ```cs services.AddHttpRemote(); ``` 2. Retrieve internet data: ```cs public class YourService(IHttpRemoteService httpRemoteService) { public async Task GetContent() { return await httpRemoteService.GetAsStringAsync("https://furion.net/"); } } ``` [More Documentation](https://http.furion.net/) ## Documentation You can find the HttpAgent documentation on our [homepage](https://http.furion.net/). ## Contributing The main purpose of this repository is to continue developing the core of HttpAgent, making it faster and easier to use. The development of HttpAgent is publicly hosted on [Gitee](https://gitee.com/dotnetchina/HttpAgent), and we appreciate community contributions for bug fixes and improvements. ## License HttpAgent is released under the [MIT](./LICENSE) open source license. [![](./assets/baiqian.svg)](https://baiqian.com)