Skip to content

HttpAgent 是一个高性能、灵活且易用的开源库,提供了全面的 HTTP 功能支持,包括文件传输、轮询、测试工具、实时通信、请求管理、Media 类型处理、MessagePack 支持、声明式请求等,并具有低资源消耗和高测试覆盖率的特点。

License

Notifications You must be signed in to change notification settings

MonkSoul/HttpAgent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HttpAgent

license nuget dotNET China

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 is characterized by low resource consumption and high test coverage.

HttpAgent.drawio

View High-Definition Architecture Diagram

Features

  • Comprehensive HTTP Method Support: Covers GET, POST, PUT, DELETE, PATCH, HEAD, TRACE, and OPTIONS methods.
  • 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.
  • Media Type Handling: Provides predefined handling mechanisms for mainstream MediaTypes and offers an open interface for custom handling.
  • Declarative Requests: Specifying the behavior of requests through simple attribute annotations or interface definitions.
  • MessagePack Support: Integrates MessagePack serialization and deserialization capabilities to enhance data exchange efficiency.
  • 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.
  • Architecture Design: Flexible architecture design that is easy to use and extend.
  • Cross-Platform Independence: Supports cross-platform operation without external dependencies.
  • 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

dotnet add package HttpAgent

Getting Started

We have many examples on our homepage. Here's your first one to get you started:

  1. Register HttpRemote service:
services.AddHttpRemote();
  1. Retrieve internet data:
public class YourService(IHttpRemoteService httpRemoteService)
{
    public async Task<string?> GetContent()
    {
        return await httpRemoteService.GetAsStringAsync("https://furion.net/");
    }
}

More Documentation

Documentation

You can find the HttpAgent documentation on our homepage.

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, and we appreciate community contributions for bug fixes and improvements.

License

HttpAgent is released under the MIT open source license.

About

HttpAgent 是一个高性能、灵活且易用的开源库,提供了全面的 HTTP 功能支持,包括文件传输、轮询、测试工具、实时通信、请求管理、Media 类型处理、MessagePack 支持、声明式请求等,并具有低资源消耗和高测试覆盖率的特点。

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages