{"id":24510204,"url":"https://github.com/link-kou/plugin-httprequest","last_synced_at":"2026-05-18T02:11:15.200Z","repository":{"id":39936394,"uuid":"267627735","full_name":"Link-Kou/Plugin-HttpRequest","owner":"Link-Kou","description":"基于Okhttp与Retrofit2整合到Spring环境中。提供代码简化。支持SSL、文件上传、文件下载、异步、同步、日志、超时、数据转换等扩展","archived":false,"fork":false,"pushed_at":"2022-12-16T15:42:41.000Z","size":179,"stargazers_count":3,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-28T00:58:29.749Z","etag":null,"topics":["http-client","httpclient","jax-rs","okhttp","okhttp3","resful-api","restful","retrofit2","rxjava3","spring"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Link-Kou.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-28T15:33:37.000Z","updated_at":"2024-10-04T20:17:05.000Z","dependencies_parsed_at":"2023-01-29T15:00:54.834Z","dependency_job_id":null,"html_url":"https://github.com/Link-Kou/Plugin-HttpRequest","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Link-Kou/Plugin-HttpRequest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Link-Kou%2FPlugin-HttpRequest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Link-Kou%2FPlugin-HttpRequest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Link-Kou%2FPlugin-HttpRequest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Link-Kou%2FPlugin-HttpRequest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Link-Kou","download_url":"https://codeload.github.com/Link-Kou/Plugin-HttpRequest/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Link-Kou%2FPlugin-HttpRequest/sbom","scorecard":{"id":84519,"data":{"date":"2025-08-11","repo":{"name":"github.com/Link-Kou/Plugin-HttpRequest","commit":"c9640bc2ba9b7d8b8056b9df5b9c732ec5787def"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-15T06:38:18.992Z","repository_id":39936394,"created_at":"2025-08-15T06:38:18.992Z","updated_at":"2025-08-15T06:38:18.992Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275304847,"owners_count":25441163,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-15T02:00:09.272Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["http-client","httpclient","jax-rs","okhttp","okhttp3","resful-api","restful","retrofit2","rxjava3","spring"],"created_at":"2025-01-22T00:27:45.817Z","updated_at":"2025-09-15T18:42:33.864Z","avatar_url":"https://github.com/Link-Kou.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Plugin-HttpRequest\n\n### Plugin-HttpRequest 能做什么？\n\n\u003e 基于OkHttp的retrofit2二次封装实现以下功能\n- 基于Spring实现@Autowired注入\n- 扩展输入输出解析，实现自定义拦截器\n- 支持Spring环境和非Spring环境\n\n## 同类\n\n- `feign` Http请求工具[https://github.com/OpenFeign/feign](https://github.com/OpenFeign/feign)\n\n\n场景\n---\n在于第三方对接中,HTTP请求是经常性使用的场景,JavaHttp请求的库有很多。\n在初期选择的时候,就是以Android为环境作为参考的。因为Android经常性与后端进行请求对接。相关的库与使用经验上面都是齐备的。\n后端在使用HTTP请求的时候,原来都是各种基于类似OkHttp这样子的框架进行封装。\n导致的问题也比较多。在使用上面，也是不太方便。所以在工作中基于这一类的问题，进行了封装。\n简化使用中的一些繁琐性的问题。\n\nMaven\n---\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.link-kou\u003c/groupId\u003e\n    \u003cartifactId\u003ehttp-request\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.7.2\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n支持功能\n---\n- `SSL` 支持绝对路径输入证书。 `支持`\n- `SSL` 支持资源路径输入证书。 `支持`\n- `文件上传` 支持Spring文件流上传。 `支持`\n- `文件上传` 支持本地文件流上传。 `支持`\n- `文件上传` 支持文件上传进度监听。 `支持`\n- `自定义@Body参数转换器以及返回参数的转换`  支持自定义转换器来实现对@Body的转换以及返回的转换 `支持`\n- `添加XML解析`  支持XML的输入输出解析 `支持`\n- `全局添加自定义请求参数` 自定义添加OKHttp拦截器 `支持`\n- `日志输出` 日志开关问题。 `支持`\n- `多服务请求` 合并多个请求服务。 `支持`\n- `超时异常重试` 支持自定义超时重试次数。 `支持`\n- `规定时间内请求缓存数据` 支持在一定的时间内请求同一个接口并且请求数据一致情况下缓存数据。 `不支持`\n- `文件下载` 支持文件异步下载。 `支持`\n- `文件断点下载` 支持文件异步断点下载。 `不支持`\n\n代码案例\n---\n`Spring配置`\n\n```xml\n\u003c!-- HTTP请求配置--\u003e\n\u003cbean class=\"com.linkkou.httprequest.spring.HTTPBeanProcessor\"\u003e\n    \u003c!--扫描包名称--\u003e\n    \u003cproperty name=\"prefix\"\u003e\n        \u003carray value-type=\"java.lang.String\"\u003e\n            \u003cvalue\u003ecom\u003c/value\u003e\n        \u003c/array\u003e\n    \u003c/property\u003e\n    \u003c!--定义输入输出转换器--\u003e\n    \u003cproperty name=\"httpConversion\"\u003e\n        \u003clist\u003e\n            \u003cbean class=\"com.linkkou.httprequest.extendPlugin.impl.HttpReturnJsonConversion\"/\u003e\n            \u003cbean class=\"com.linkkou.httprequest.extendPlugin.impl.HttpReturnXmlConversion\"/\u003e\n        \u003c/list\u003e\n    \u003c/property\u003e\n    \u003c!--定义拦截器--\u003e\n    \u003cproperty name=\"okhttpInterceptor\"\u003e\n        \u003clist\u003e\n            \u003cbean class=\"com.Spring.interceptor.InterceptorCookiePlus\"/\u003e\n        \u003c/list\u003e\n    \u003c/property\u003e\n    \u003c!--配置文件--\u003e\n    \u003cproperty name=\"locations\"\u003e\n        \u003clist\u003e\n            \u003cvalue\u003eclasspath*:*/*/httpurl.properties\u003c/value\u003e\n        \u003c/list\u003e\n    \u003c/property\u003e\n\u003c/bean\u003e\n```\n\n```java\n/**\n * @author lk\n * @version 1.0\n * @date 2020/9/11 11:29\n */\npublic class HttpRequestConfig {\n\n    @Bean\n    public HTTPBeanProcessor httpBeanProcessor() throws IOException {\n        HTTPBeanProcessor httpBeanProcessor = new HTTPBeanProcessor();\n        httpBeanProcessor.setPrefix(Arrays.asList(\"com\").toArray(new String[0]));\n        final HttpReturnJsonConversion httpReturnJsonConversion = new HttpReturnJsonConversion();\n        httpBeanProcessor.setHttpConversion(Arrays.asList(httpReturnJsonConversion));\n        httpBeanProcessor.setLocations(\n                new PathMatchingResourcePatternResolver().getResources(\"classpath*:httpurl.properties\")\n        );\n        return httpBeanProcessor;\n    }\n}\n\n```\n\n`基本使用方式`\n---\n支持retrofit2所有使用方式。你会retrofit2就可以极低成本的在Spring环境中使用retrofit2。于此同时。借助retrofit2的齐全文档。有效解决学习成本问题\n\n```java\n\n/**\n * 高德API示列\n *\n * @author lk\n * @version 1.0\n * @date 2019/4/17 17:53\n */\n@HTTPRequest(value = @Value(\"${amap.url}\"))\npublic interface ApiAmap {\n\n    /**\n     * 高德 天气查询\n     *\n     * @param key        用户在高德地图官网申请web服务API类型KEY\n     * @param city       输入城市的adcode，adcode信息可参考城市编码表\n     * @param extensions 可选值：base/all base:返回实况天气 all:返回预报天气 可选性输入null\n     * @param output     可选值：JSON,XML 可选性输入null\n     * @return 天气对象\n     */\n    @GET(\"weather/weatherInfo\")\n    HTTPResponse\u003cRepWeather\u003e weather(@Query(\"key\") String key,\n                                     @Query(\"city\") String city,\n                                     @Query(\"extensions\") String extensions,\n                                     @Query(\"output\") String output);\n\n}\n\n```\n\n代码案例\n---\n`非Spring配置`\n\n```java\n\n@HTTPRequestTest(\"httpurl.properties\")\nprivate ApiAmap apiAmap;\n\n```\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flink-kou%2Fplugin-httprequest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flink-kou%2Fplugin-httprequest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flink-kou%2Fplugin-httprequest/lists"}