{"id":33179344,"url":"https://github.com/paohaijiao/jquick-curl","last_synced_at":"2026-03-10T14:32:10.864Z","repository":{"id":300423410,"uuid":"1006119809","full_name":"paohaijiao/jquick-curl","owner":"paohaijiao","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-03T11:24:02.000Z","size":719,"stargazers_count":845,"open_issues_count":0,"forks_count":33,"subscribers_count":22,"default_branch":"main","last_synced_at":"2026-03-03T14:30:09.574Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paohaijiao.png","metadata":{"files":{"readme":"README-EN.md","changelog":"change.log","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-21T14:38:08.000Z","updated_at":"2026-03-03T14:02:50.000Z","dependencies_parsed_at":"2025-07-13T13:17:59.355Z","dependency_job_id":"db83ec9d-f455-459e-b1b9-7a6357eba482","html_url":"https://github.com/paohaijiao/jquick-curl","commit_stats":null,"previous_names":["paohaijiao/jquick-curl"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/paohaijiao/jquick-curl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paohaijiao%2Fjquick-curl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paohaijiao%2Fjquick-curl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paohaijiao%2Fjquick-curl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paohaijiao%2Fjquick-curl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paohaijiao","download_url":"https://codeload.github.com/paohaijiao/jquick-curl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paohaijiao%2Fjquick-curl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30337213,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T12:41:07.687Z","status":"ssl_error","status_checked_at":"2026-03-10T12:41:06.728Z","response_time":106,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-11-16T03:00:36.829Z","updated_at":"2026-03-10T14:32:10.855Z","avatar_url":"https://github.com/paohaijiao.png","language":"Java","funding_links":[],"categories":["网络编程","Projects"],"sub_categories":["HTTP Clients"],"readme":"# JQuickCurl - Java HTTP Client Framework Based on cURL\n## [简体中文](./README) | English\n## 📖 Project Introduction\nJQuickCurl is a high-performance, easy-to-use HTTP client framework designed for Java developers.\nIt is deeply adapted to the concurrency features of Java 8, and its core advantage lies in directly \nconverting cURL commands into executable HTTP request logic - without the need to manually write \nunderlying HTTP client code such as RestTemplate and OkHttp, and without paying attention to tedious \ndetails such as request construction, parameter encapsulation, and response parsing. By simply passing \nin familiar cURL commands, the framework can automatically complete request conversion and execution, \nallowing developers to quickly implement various HTTP operations such as GET, POST, PUT, DELETE in the\nmost intuitive way, significantly reducing network request development costs while ensuring request \nefficiency and stability.\n## 📊 Project Status\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-5470c6.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Version](https://img.shields.io/badge/Version-1.2.0-91cc75.svg)](https://github.com/paohaijiao/jquick-curl/releases)\n[![Downloads](https://img.shields.io/badge/Downloads-15K/month-fac858.svg)](https://maven-badges.herokuapp.com/maven-central/io.paohaijiao/jquick-curl)\n[![Contributors](https://img.shields.io/badge/Contributors-24-3ba272.svg)](https://github.com/paohaijiao/jquick-curl/graphs/contributors)\n[![Build](https://img.shields.io/badge/Build-Passing-ee6666.svg)](https://github.com/paohaijiao/jquick-curl/actions)\n[![Test Coverage](https://img.shields.io/badge/Coverage-92%25-73c0de.svg)](https://github.com/paohaijiao/jquick-curl)\n[![Issues](https://img.shields.io/badge/Issues-12-9a60b4.svg)](https://github.com/paohaijiao/jquick-curl/issues)\n## 🌟 Core Label\n⚡ High Performance | 🎯 User Friendly | 🔧 Flexible | 📦 LightWeight\n## 📖 目录\n- [✨ Characteristic Introduction](#Characteristic Introduction)\n- [🚀 Quick Start](#Quick Start)\n- [🔧 Core Functionality](#Core Functionality)\n  - [HTTP method support](#HTTP method support)\n  - [File Operations](#File Operations)\n  - [Advanced Features](#Advanced Features)\n- [📝 Configuration Method](#Configuration Method)\n  - [Annotation Configuration](#Annotation Configuration)\n  - [XML Configuration](#XML Configuration)\n- [🧪 Testing Guide](#Testing Guide)\n- [📚 API Reference](#API Reference)\n- [🔍 FAQ](#FAQ)\n- [🤝 Contribution Guide](#Contribution Guide)\n- [📄 License](#License)\n- [💝 Support US](#Support US)\n## 🚀 Core Feature\n- CURL style API: Define HTTP requests using cURL command syntax\n- Multi protocol support: GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS, TRACE\n- File upload and download: supports single file, multiple file upload, and file download\n- Annotation driven: Simplify API definition using @ JCurlCommand annotation\n- Proxy mode: supports dynamic proxy generation API client\n- XML configuration: Supports configuring API interfaces in XML format\n- Variable replacement: supports global variable and parameter replacement\n- Lambda support: provides a way to call Lambda expressions\n- Interceptor: Supports request/response interceptors\n- Batch execution: supports batch execution of cURL commands\n\n## User Guide\n### Basic Grammar\n```bash\n# Universal format\ncurl [options] [URL]\n\n# Example: GET request\ncurl https://api.example.com/user\n# Example: POST request with request header\ncurl -X POST -H \"Content-Type: application/json\" -d '{\"name\":\"test\"}' https://api.example.com/user\n### Basic Options\n```string\n# Request Method\n-X, --request \u003c方法\u003e        # Specify the request method（GET/POST/PUT/DELETE/PATCH/HEAD/OPTIONS/TRACE）\n# Request Header\n-H, --header \u003c请求头\u003e       # Add HTTP request header\n# Data transmission (POS/PUT specific)\n-d, --data \u003c数据\u003e           # Sending regular data\n--data-ascii \u003c数据\u003e         # Send ASCII format data\n--data-binary \u003c数据\u003e        # Sending binary data\n--data-raw \u003c数据\u003e           # Sending unprocessed raw data\n--data-urlencode \u003c数据\u003e     # Send URL encoded form data\n# Authorization related\n-u, --user \u003c用户:密码\u003e      # Server username and password\n# redirect\n-L, --location              # Follow redirect\n--max-redirs \u003c次数\u003e         # Maximum number of redirects\n# output control\n-o, --output \u003c文件\u003e         # Write output to a file instead of standard output\n# File/Form Upload\n-F, --form \u003c名称=内容\u003e      # Specify multi part form data\n# Agency related\n-x, --proxy \u003c[协议://]主机[:端口]\u003e  #Use HTTP/HTTPS proxy\n--socks5-hostname \u003c主机[:端口]\u003e     # SOCKS5 Proxy\n# Protocol/Security\n--http2                     # Using HTTP/2 protocol\n-k, --insecure              # Allow insecure server connections\n```\n\n## 📦 Quick Start\n### 1. Add dependency\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.github.paohaijiao\u003c/groupId\u003e\n    \u003cartifactId\u003ejquick-curl\u003c/artifactId\u003e\n    \u003cversion\u003e${latest.version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n## 2. Basic usage\n### 2.1 Define Service Interface\n```java\nimport java.util.List;\n// 示例UserService接口定义\npublic interface UserService {\n\n    /**\n     * 获取所有用户\n     * @param req 请求参数载体\n     * @return 所有用户列表\n     */\n    @JCurlCommand(\"curl -X GET --location 'http://localhost:8080/api/users/all'\")\n    List\u003cJUser\u003e all(JQuickCurlReq req);\n\n    /**\n     * 根据ID获取单个用户\n     * @param req 请求参数载体\n     * @return 单个用户信息\n     */\n    @JCurlCommand(\"curl -X GET http://localhost:8080/api/users/1\")\n    JUser getUserById(JQuickCurlReq req);\n\n    /**\n     * 创建新用户（POST请求）\n     * @param req 请求参数载体\n     * @return 创建后的用户信息\n     */\n    @JCurlCommand(\"curl -X POST http://localhost:8080/api/users/createUser \\\\\\n\" +\n            \"-H \\\"Content-Type: application/json\\\" \\\\\\n\" +\n            \"-d '{\\\"name\\\":\\\"John Doe\\\",\\\"email\\\":\\\"john@example.com\\\"}'\")\n    JUser users(JQuickCurlReq req);\n}\n```\n### 2.2 Create Service Bean\n```java\n// 1. 创建UserService代理实例\nUserService api = JCurlInvoker.createProxy(UserService.class);\n\n// 2. 准备请求参数\nJQuickCurlReq req = new JQuickCurlReq();\nreq.put(\"user\", \"xsasaxsa@qq.com\");\nreq.put(\"password\", \"xasxsa\");\n\n// 3. 执行HTTP请求并获取结果\nList\u003cJUser\u003e users = api.all(req);       // 获取所有用户\nJUser user = api.getUserById(req);      // 根据ID获取用户\n```\n### 2.3 Use With Lambda \n\u003e 运行示例：\n```java\n// 1. 准备请求参数\nJQuickCurlReq req = new JQuickCurlReq();\nreq.put(\"user\", \"xsaxsa@qq.com\");\nreq.put(\"password\", \"zaZAzaZA\");\n\n// 2. Lambda风格调用接口方法\nList\u003cJUser\u003e list = JCurlInvoker.invoke(\n        UserServiceImpl::all,    // 目标方法引用\n        req,                     // 请求参数\n        List.class               // 返回值类型\n);\n\nJUser user = JCurlInvoker.invoke(\n        UserServiceImpl::getUserById,\n        req,\n        JUser.class\n);\n```\n## 🔧 Detailed Functional Examples\n### 1.Basic HTTP Methods\n```java\n    ApiService api = JCurlInvoker.createProxy(ApiService.class);\n    JQuickCurlReq req = new JQuickCurlReq();\n    req.put(\"user\", \"xsasaxsa@qq.com\");\n    req.put(\"password\", \"xasxsa\");\n    JGithubAuth result = api.retriveUser(req);\n```\n#### 2. GET Request (Query Resources)\n```java\n/**\n * 根据用户ID查询单个用户信息\n * GET请求：无请求体，直接通过URL获取资源\n */\n@JCurlCommand(\"curl -X GET http://localhost:8080/api/users/1\")\nJUser getUserById(JQuickCurlReq req);\n/**\n * 创建新用户\n * POST请求：携带JSON格式请求体，指定Content-Type为application/json\n */\n@JCurlCommand(\"curl -X POST http://localhost:8080/api/users/createUser \\\\\\n\" +\n        \"-H \\\"Content-Type: application/json\\\" \\\\\\n\" +\n        \"-d '{\\\"name\\\":\\\"John Doe\\\",\\\"email\\\":\\\"john@example.com\\\"}'\")\nJUser users(JQuickCurlReq req);\n/**\n * 全量更新用户信息\n * PUT请求：替换指定ID的完整用户信息，需传递全部字段\n */\n@JCurlCommand(\"curl -X PUT http://localhost:8080/api/users/1 \\\\\\n\" +\n        \"-H \\\"Content-Type: application/json\\\" \\\\\\n\" +\n        \"-d '{\\\"name\\\":\\\"John Doe Updated\\\",\\\"email\\\":\\\"john.updated@example.com\\\"}'\")\nJUser usersPut(JQuickCurlReq req);\n/**\n * 删除指定ID的用户\n * DELETE请求：无返回值（Void），仅执行删除操作\n */\n@JCurlCommand(\"curl -X DELETE http://localhost:8080/api/users/1\")\nVoid usersDelete(JQuickCurlReq req);\n/**\n * PATCH请求：局部更新用户信息（仅修改需要变更的字段）\n */\n@JCurlCommand(\"curl -X PATCH http://localhost:8080/api/users/1\")\nJUser usersPatch(JQuickCurlReq req);\n\n/**\n * HEAD请求：仅获取响应头信息（-I参数），无响应体\n */\n@JCurlCommand(\"curl -X HEAD -I http://localhost:8080/api/users/1\")\nVoid usersHead(JQuickCurlReq req);\n\n/**\n * OPTIONS请求：获取服务器支持的HTTP方法列表\n */\n@JCurlCommand(\"curl -X OPTIONS http://localhost:8080/api/users/1\")\nJResult usersOptions(JQuickCurlReq req);\n\n/**\n * TRACE请求：回显服务器收到的请求，用于调试\n */\n@JCurlCommand(\"curl -X TRACE http://localhost:8080/api/users/trace\")\nString usersTrace(JQuickCurlReq req);\n/**\n * 上传单个文件\n * -F参数：指定multipart/form-data格式，@符号后为本地文件路径\n */\n@JCurlCommand(\"curl -X POST http://localhost:8080/api/users/upload \\\\\\n\" +\n        \"-F \\\"file=@D:\\\\test\\\\test.txt\\\"\")\nString upload(JQuickCurlReq req);\n/**\n * 批量上传多个文件\n * 多个-F参数：同名参数（files）传递多个文件，服务端接收文件列表\n */\n@JCurlCommand(\"curl -X POST http://localhost:8080/api/users/upload-multiple \\\\\\n\" +\n        \"-F \\\"files=@D:\\\\test\\\\test.txt\\\" \\\\\\n\" +\n        \"-F \\\"files=@D:\\\\test\\\\test1.txt\\\"\")\nString upload1(JQuickCurlReq req);\n/**\n * 下载文件到指定路径\n * --output参数：将响应内容写入本地文件，返回字节数组（byte[]）便于处理\n */\n@JCurlCommand(\"curl -X GET http://localhost:8080/api/users/download/test.txt \\\\\\n\" +\n        \"--output 'd://test//download.txt'\")\nbyte[] download(JQuickCurlReq req);\n/**\n * 上传文件并携带额外表单参数\n * 混合-F参数：既有普通表单字段（userId/username），也有文件字段（file）\n */\n@JCurlCommand(\"curl -X POST http://localhost:8080/api/users/upload-with-params \\\\\\n\" +\n        \"-F \\\"userId=123\\\" \\\\\\n\" +\n        \"-F \\\"username=john\\\" \\\\\\n\" +\n        \"-F \\\"file=@D:\\\\test\\\\test.txt\\\"\")\nString uploadWithPostParams(JQuickCurlReq req);\n/**\n * HTTP基础认证\n * -u参数：传递用户名和密码（使用${变量}占位符，运行时从req中替换）\n * 格式：-u ${user}:${password} 对应 req.put(\"user\", \"xxx\") / req.put(\"password\", \"xxx\")\n */\n@JCurlCommand(\"curl -u ${user}:${password} https://api.github.com/user -X GET\")\nJGithubAuth retriveUser(JQuickCurlReq req);\n```\n## 📝 XML Configuration\n### 1. Define XML configuration file (apis.xml)\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003c!DOCTYPE curls PUBLIC \"-//PAOHAIJIAO//DTD API CURL 1.0//EN\"\n        \"classpath:paohaijiao/dtd/Jquick-curl.dtd\"\u003e\n\u003c!-- \n  XML配置说明：\n  - namespace：绑定对应的Java接口全类名\n  - curl节点：每个节点对应一个接口方法\n    - name：方法名（需与Java接口方法名一致）\n    - returnClass：方法返回值类型（全类名）\n --\u003e\n\u003ccurls namespace=\"com.github.paohaijiao.test.xml.UserApi\"\u003e\n    \u003c!-- 获取所有用户列表 --\u003e\n    \u003ccurl name=\"all\" returnClass=\"java.util.List\"\u003e\n        curl -X GET --location 'http://localhost:8080/api/users/all'\n    \u003c/curl\u003e\n    \n    \u003c!-- 根据ID获取单个用户 --\u003e\n    \u003ccurl name=\"getUserById\" returnClass=\"com.github.paohaijiao.test.model.JUser\"\u003e\n        curl -X GET http://localhost:8080/api/users/1\n    \u003c/curl\u003e\n    \n    \u003c!-- 带变量替换的用户查询（动态主机地址） --\u003e\n    \u003ccurl name=\"getUserByIdVariable\" returnClass=\"com.github.paohaijiao.test.model.JUser\"\u003e\n        curl -X GET ${host}\n    \u003c/curl\u003e\n\u003c/curls\u003e\n```\n### 2.  Define Java interface (bound with XML configuration)\n\n```java\n/**\n * UserApi接口\n * 方法名、参数、返回值需与XML配置中的curl节点一一对应\n */\npublic interface UserApi {\n    // 获取所有用户（无动态参数）\n    List\u003cJUser\u003e all(JQuickCurlReq req);\n    \n    // 根据ID获取用户（固定URL）\n    JUser getUserById(JQuickCurlReq req);\n    \n    // 动态主机地址的用户查询（@Param注解绑定XML中的${host}变量）\n    JUser getUserByIdVariable(@Param(\"host\")String host);\n}\n```\n### 3.Create an instance using the factory and call it\n\n```java\n// 1. 创建CurlApiFactory，加载XML配置文件\nCurlApiFactory factory = new CurlApiFactory(\"apis.xml\");\n\n// 2. 生成UserApi接口的代理实例\nUserApi userApi = factory.createApi(UserApi.class);\n\n// 3. 调用接口方法\n// 3.1 调用无参方法\nList\u003cJUser\u003e users = userApi.all(req);\n\n// 3.2 调用带动态变量的方法（替换XML中的${host}）\nJUser user = userApi.getUserByIdVariable(\"http://localhost:8080/api/users/1\");\n```\n## 🛠 Advanced Features\n### 1. Batch Execution\n```java\n/**\n * 批量执行curl命令\n * JQuickCurlBatchRunner：批量执行器，支持一次性执行多个curl命令\n * runCurlCommands：执行指定的批量命令类，统一返回JResult类型的结果列表\n */\nJQuickCurlBatchRunner batch = new JQuickCurlBatchRunner();\nList\u003cJResult\u003e results = batch.runCurlCommands(new JCurlBatchCommandTest(), JResult.class);\n```\n### 2. Global variable support\n```java\n/**\n* 命令中使用${变量名}占位符，运行时从JQuickCurlReq中取值替换\n* 适用场景：通用配置（如认证信息、基础域名），避免硬编码\n  */\n  @JCurlCommand(\"curl -u ${user}:${password} https://api.github.com/user -X GET\")\n  JGithubAuth retriveUser(JQuickCurlReq req);\n// 调用示例（${字段名} 字段级别）\nApiService api = JCurlInvoker.createProxy(ApiService.class);\nJQuickCurlReq req = new JQuickCurlReq();\n// 给占位符${user}/${password}赋值\nreq.put(\"user\", \"xsasaxsa@qq.com\");\nreq.put(\"password\", \"xasxsa\");\n// 执行请求，框架自动替换变量\nJGithubAuth result = api.retriveUser(req);\n```\n### 3. Parameterized interface method\n\n```java\n/**\n* 接口方法参数绑定（#{参数名}占位符 + @Param注解）\n* 适用场景：动态拼接请求体/URL，直接使用方法入参，无需通过JQuickCurlReq传递\n* 注意：占位符格式为#{参数名}，需与@Param注解的value一致\n  */\n  @JCurlCommand(\"curl -X POST http://localhost:8080/api/users/createUser \\\\\\n\" +\n  \"-H \\\"Content-Type: application/json\\\" \\\\\\n\" +\n  \"-d '{\\\"name\\\":#{name},\\\"email\\\":#{email}}'\")\n  JUser usersByVariable(@Param(\"name\")String name, @Param(\"email\")String email);\n\n// 调用示例（直接传参（#{字段名}），更符合Java接口调用习惯）\n// UserService api = JCurlInvoker.createProxy(UserService.class);\n// JUser user = api.usersByVariable(\"John Doe\", \"john@example.com\");\n```\n### 4. Interceptor\n###  Request/Response Interceptor\n\n```java\npackage com.github.paohaijiao.interceptor;\n\nimport com.github.paohaijiao.enums.JCurlLevelLog;\nimport lombok.extern.slf4j.Slf4j;\nimport okhttp3.*;\n\nimport java.io.IOException;\nimport java.nio.charset.Charset;\nimport java.nio.charset.StandardCharsets;\n\n@Slf4j\npublic class CustomInterceptor implements Interceptor {\n\n   private static final Charset UTF8 = StandardCharsets.UTF_8;\n\n   private final JCurlLevelLog level;\n\n   public JLoggingInterceptor() {\n      this(JCurlLevelLog.ALL);\n   }\n\n   public JLoggingInterceptor(JCurlLevelLog level) {\n      this.level = level;\n   }\n\n   @Override\n   public Response intercept(Chain chain) throws IOException {\n      Request request = chain.request();\n      // 示例：统一添加Token请求头\n      // request.addHeader(\"Authorization\", \"Bearer \" + getToken());\n      Response response;\n      try {\n         response = chain.proceed(request);\n      } catch (Exception e) {\n         log.error(\"\u003c-- HTTP FAILED: \" + e);\n         throw e;\n      }\n\n      // 示例：统一添加响应\n      return response;\n   }\n// 全局配置拦截器（生效于所有请求）\nJQuickCurlConfig config = JQuickCurlConfig.getInstance();\n// 添加自定义拦截器（支持添加多个，按添加顺序执行）\nconfig.addInterceptor(new CustomInterceptor());\n```\n## 📋 Test case examples\n### 1. Unit testing (basic functional verification)\n```java\nimport org.junit.Test;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.nio.file.StandardOpenOption;\n\n/**\n * JCurlInvoker 核心功能单元测试\n * 验证代理调用、参数传递、文件下载等基础功能\n */\npublic class JCurlInvokerInvokeTest {\n    \n    /**\n     * 测试基础认证接口调用（全局变量替换）\n     * 验证${user}/${password}占位符替换和接口返回值解析\n     */\n    @Test\n    public void retriveUser() throws Exception {\n        // 创建API代理实例\n        ApiService api = JCurlInvoker.createProxy(ApiService.class);\n        \n        // 准备请求参数（绑定全局变量）\n        JQuickCurlReq req = new JQuickCurlReq();\n        req.put(\"user\", \"xsasaxsa@qq.com\");\n        req.put(\"password\", \"xasxsa\");\n        \n        // 执行请求并获取结果\n        JGithubAuth result = api.retriveUser(req);\n        System.out.println(result); // 打印结果用于调试\n    }\n    \n    /**\n     * 测试文件下载功能\n     * 验证字节数组返回值处理及本地文件写入\n     */\n    @Test\n    public void downloadByte() throws Exception {\n        // 创建API代理实例\n        UserService api = JCurlInvoker.createProxy(UserService.class);\n        \n        // 准备请求参数\n        JQuickCurlReq req = new JQuickCurlReq();\n        req.put(\"user\", \"xsasaxsa@qq.com\");\n        req.put(\"password\", \"xasxsa\");\n        \n        // 执行下载请求，获取字节数组\n        byte[] bytes = api.download(req);\n        \n        // 将下载的字节写入本地文件\n        Path path = Paths.get(\"d://test/xx1.txt\");\n        Files.write(path, bytes, StandardOpenOption.CREATE);\n    }\n}\n```\n### 2. XML configuration testing (configured interface validation)\n\n```java\nimport org.junit.Test;\nimport java.util.List;\n\n/**\n* XML配置方式的接口调用测试\n* 验证XML配置加载、接口代理生成、配置化接口调用\n  */\n  public class CurlApiExample {\n\n  /**\n    * 测试XML配置的接口调用\n    * 验证apis.xml配置加载及all方法的执行结果\n      */\n      @Test\n      public void all1() throws Exception {\n      // 准备请求参数\n      JQuickCurlReq req = new JQuickCurlReq();\n      req.put(\"user\", \"xsaxsa@qq.com\");\n      req.put(\"password\", \"zaZAzaZA\");\n\n      // 加载XML配置文件，创建工厂实例\n      CurlApiFactory factory = new CurlApiFactory(\"apis.xml\");\n\n      // 生成XML绑定的接口代理\n      UserApi userApi = factory.createApi(UserApi.class);\n\n      // 执行接口方法，获取结果并打印\n      List\u003cJUser\u003e list = userApi.all(req);\n      System.out.println(list);\n      }\n      }\n```\n## 📚 API reference\n### Core Class\n| Class Name         | Functional Description|\n|--------------------|----------|\n| `JCurlInvoker`     | Core caller, supporting proxy creation and Lambda calling|\n| `JQuickCurlReq`    | Request parameter container, used to store request headers, parameters, variables, etc |\n| `JQuickCurlConfig` | Global configuration class, managing interceptors, global parameters, and other configurations |\n| `JContext`         | Execute context and store context information for requests/responses |\n| `JResult`          | Universal response results, encapsulating response status, data, exceptions, etc |\n| `CurlApiFactory`   | XML configuration factory, used to load XML configurations and generate interface proxies|\n\n### Core Annotations\n| Annotation Name| Functional Description|\n|--------|----------|\n| `@JCurlCommand` | Annotate on the interface method and define the corresponding cURL command |\n| `@Param` | Method parameter mapping annotation, bind # {parameter name} placeholder in cURL command |\n\n## 🤝 Contribution Guide\nWe warmly welcome community contributions, and you can participate in the following ways：\n- Submit Issue: Provide bug feedback, suggest new features, optimize documentation\n- Submit Pull Request: Fix bugs, add new features, and improve test cases\n- Participate in discussion: Exchange technical solutions and usage experience in the issue\n\n### Contribution standards\n1. Fork this project to personal warehouse\n2. Create feature branch （`feature/xxx` or `fix/xxx`）\n3. Submit code and maintain consistent code style\n4. Write/update test cases to ensure functionality is available\n5. Submit a PR that clearly describes the changes and the issues addressed\n6. \n## 📄 License\nThis project is licensed under the **Apache License 2.0** open-source license. For details, please refer to the [LICENSE](LICENSE) file.\n\n## 💖 Support the Project\nIf this project is helpful to you, please support us in the following ways:\n- ⭐ **Star** the project: Click the Star button in the upper right corner of the GitHub repository\n- 🐛 **Report issues**: Submit an Issue to report problems or suggestions encountered during use\n- 🔀 **Contribute code**: Submit a Pull Request to improve features or fix bugs\n\nThank you for using this open-source project! It is completely free and will be continuously maintained, but developers truly need your support.\n\n---\n\n## **How to Support Us**\n\n1. **Buy Me a Coffee**  \n   If this project has saved you time or money, please consider supporting me with a small donation.\n\n2. **Where Your Donation Goes**\n- Covering server costs to keep the project running.\n- Developing new features to deliver more value.\n- Optimizing documentation to enhance user experience.\n\n3. **Every Penny Counts**  \n   Even a donation of just one cent can motivate me to debug code late into the night!\n## **Why Donate?**\n✔️ Keep the project forever free and ad-free.  \n✔️ Support timely responses to issues and community inquiries.  \n✔️ Realize planned future features.\n\nThank you for being a partner in making the open-source world better!\n\n--- \n\n### **Additional Notes**\n- Maintenance of this project and related products.\n- Your support ensures its sustainability and growth.\n---\n\n## **🌟 Support Us Now**\nFeel free to leave a message via [email](mailto:goudingcheng@gmail.com) when making a donation. Your name will be listed in the **\"Special Thanks\"** section of the project's README file!\n![Pay Now](./src/main/resources/pay/paynow.jpg)\n![TNG go](./src/main/resources/pay/tngGo.jpg)\n\n---","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaohaijiao%2Fjquick-curl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaohaijiao%2Fjquick-curl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaohaijiao%2Fjquick-curl/lists"}