{"id":15479642,"url":"https://github.com/niuhuan/feign-rs","last_synced_at":"2025-10-08T10:50:51.287Z","repository":{"id":57628291,"uuid":"449729376","full_name":"niuhuan/feign-rs","owner":"niuhuan","description":"A restful http client of rust. like java feign.","archived":false,"fork":false,"pushed_at":"2025-09-04T08:06:01.000Z","size":73,"stargazers_count":19,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-05T04:29:09.366Z","etag":null,"topics":["feign","http-client","restful","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/niuhuan.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2022-01-19T14:40:51.000Z","updated_at":"2025-09-28T12:35:35.000Z","dependencies_parsed_at":"2025-04-22T15:14:13.042Z","dependency_job_id":"64d5aeaa-97f6-4ec6-be35-936bdb9e1f5e","html_url":"https://github.com/niuhuan/feign-rs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/niuhuan/feign-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niuhuan%2Ffeign-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niuhuan%2Ffeign-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niuhuan%2Ffeign-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niuhuan%2Ffeign-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niuhuan","download_url":"https://codeload.github.com/niuhuan/feign-rs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niuhuan%2Ffeign-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278931653,"owners_count":26070788,"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-10-08T02:00:06.501Z","response_time":56,"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":["feign","http-client","restful","rust"],"created_at":"2024-10-02T04:22:18.592Z","updated_at":"2025-10-08T10:50:51.282Z","avatar_url":"https://github.com/niuhuan.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n![](images/icon.png)\n\n\u003c/div\u003e\n\n\u003ch1 align=\"center\"\u003e\nFeign-RS (Rest client of Rust)\n\u003c/h1\u003e\n\n### [Start to use](https://github.com/niuhuan/feign-rs/tree/master/guides)\n\n## Examples\n\n```rust\nuse serde_derive::Deserialize;\nuse serde_derive::Serialize;\nuse std::collections::HashMap;\nuse feign::{client, ClientResult, Args};\n\n#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]\npub struct User {\n    pub id: i64,\n    pub name: String,\n}\n\n#[derive(Args)]\npub struct PutUserArgs {\n    #[feign_path]\n    pub id: i64,\n    #[feign_query]\n    pub q: String,\n    #[feign_json]\n    pub data: User,\n    #[feign_headers]\n    pub headers: HashMap\u003cString, String\u003e,\n}\n\n#[client(host = \"http://127.0.0.1:3000\", path = \"/user\")]\npub trait UserClient {\n\n    #[get(path = \"/find_by_id/\u003cid\u003e\")]\n    async fn find_by_id(\u0026self, #[path] id: i64) -\u003e ClientResult\u003cOption\u003cUser\u003e\u003e;\n\n    #[post(path = \"/new_user\")]\n    async fn new_user(\u0026self, #[json] user: \u0026User) -\u003e ClientResult\u003cOption\u003cString\u003e\u003e;\n\n    #[put(path = \"/put_user/\u003cid\u003e\")]\n    async fn put_user(\u0026self, #[args] args: PutUserArgs) -\u003e ClientResult\u003cUser\u003e;\n}\n\n#[tokio::main]\nasync fn main() {\n    let user_client: UserClient = UserClient::new();\n\n    match user_client.find_by_id(12).await {\n        Ok(option) =\u003e match option {\n            Some(user) =\u003e println!(\"user : {}\", user.name),\n            None =\u003e println!(\"none\"),\n        },\n        Err(err) =\u003e panic!(\"{}\", err),\n    };\n}\n```\n\n## Features\n\n- Easy to use\n- Asynchronous request\n- Configurable agent\n- Supports form, JSON\n- Reconfig host\n- Additional request processer\n- Custom deserializer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniuhuan%2Ffeign-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniuhuan%2Ffeign-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniuhuan%2Ffeign-rs/lists"}