# Unity网络框架 **Repository Path**: Jerry12186/unity-network-framework ## Basic Information - **Project Name**: Unity网络框架 - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2025-06-25 - **Last Updated**: 2025-12-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Jerry.Net 网络库 ## 特性 - 提供简单易用的 HTTP 请求封装 - 支持异步 GET 和 POST 请求 - 使用泛型接口实现类型安全的数据处理 - 包含示例类用于快速开始测试 ## 核心组件 ### HttpHelper 封装了常用的 HTTP 请求方法,提供以下功能: - 设置请求超时时间 - 异常处理事件 `OnError` - 异步获取数据 `GetAsync` - 异步发送数据 `PostAsync` ### IResult 定义结果解析接口,包含一个方法: - `ParserJson(string json)` 用于将 JSON 字符串解析为对象 ### ISend 定义发送数据接口,用于标识可序列化并发送的数据类型。 ## 使用示例 ### 发起 GET 请求 ```csharp HttpHelper helper = new HttpHelper(); TestJson result = await helper.GetAsync("https://api.example.com/data"); ``` ### 发起 POST 请求 ```csharp HttpHelper helper = new HttpHelper(); SendTest sendData = new SendTest { stuId = 123 }; TestJson result = await helper.PostAsync("https://api.example.com/submit", sendData); ``` ## 安装要求 - Unity 项目支持 UniTask - https://github.com/Cysharp/UniTask.git - .NET Standard 2.0 或更高版本 ## 注意事项 - 确保目标平台支持网络请求 - 需要 JSON 序列化支持(已包含 `[Serializable]` 属性示例) ## 许可证 本项目采用 MIT 许可证。详情请查看 LICENSE 文件。