{"id":21973162,"url":"https://github.com/dxx/feignhttp","last_synced_at":"2025-07-24T11:02:06.690Z","repository":{"id":40825540,"uuid":"345259890","full_name":"dxx/feignhttp","owner":"dxx","description":":toolbox: Declarative HTTP client for rust","archived":false,"fork":false,"pushed_at":"2023-06-14T13:37:00.000Z","size":198,"stargazers_count":58,"open_issues_count":2,"forks_count":7,"subscribers_count":0,"default_branch":"dev","last_synced_at":"2024-05-16T01:03:13.685Z","etag":null,"topics":["http","rust"],"latest_commit_sha":null,"homepage":"https://docs.rs/feignhttp","language":"Rust","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/dxx.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-07T04:41:57.000Z","updated_at":"2024-04-09T09:44:03.000Z","dependencies_parsed_at":"2024-11-29T15:42:47.378Z","dependency_job_id":null,"html_url":"https://github.com/dxx/feignhttp","commit_stats":{"total_commits":225,"total_committers":5,"mean_commits":45.0,"dds":0.4666666666666667,"last_synced_commit":"e657a5807d7805792b838493912aa218d7238bfa"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxx%2Ffeignhttp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxx%2Ffeignhttp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxx%2Ffeignhttp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxx%2Ffeignhttp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dxx","download_url":"https://codeload.github.com/dxx/feignhttp/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230527866,"owners_count":18240051,"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","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","rust"],"created_at":"2024-11-29T15:25:23.461Z","updated_at":"2024-12-20T03:09:15.906Z","avatar_url":"https://github.com/dxx.png","language":"Rust","readme":"# FeignHTTP\n\n[![crates.io](https://img.shields.io/crates/v/feignhttp.svg)](https://crates.io/crates/feignhttp)\n[![Documentation](https://docs.rs/feignhttp/badge.svg)](https://docs.rs/feignhttp)\n[![MIT licensed](https://img.shields.io/github/license/dxx/feignhttp.svg?color=blue)](./LICENSE)\n[![CI](https://github.com/dxx/feignhttp/workflows/CI/badge.svg)](https://github.com/dxx/feignhttp/actions?query=workflow%3ACI)\n\nFeignHTTP is a declarative HTTP client. Based on rust macros.\n\n## Features\n\n* Easy to use\n* Asynchronous request\n* Configurable timeout settings\n* Supports form, plain text and JSON\n* Selectable HTTP backends ([reqwest](https://github.com/seanmonstar/reqwest) or [isahc](https://github.com/sagebind/isahc))\n\n## Usage\n\nFeignHTTP mark macros on asynchronous functions, you need a runtime for support async/await. You can use [async-std](https://github.com/async-rs/async-std) or [tokio](https://github.com/tokio-rs/tokio).\n\nasync-std:\n\n```toml\n[dependencies]\nasync-std = { version = \"1\", features = [\"attributes\", \"tokio1\"] }\n```\n\nThe feature `tokio1` is need when use reqwest as the HTTP backend.\n\ntokio:\n\n```toml\n[dependencies]\ntokio = { version = \"1\", features = [\"full\"] }\n```\n\nAdd `feignhttp` in your `Cargo.toml` and use default feature:\n\n```toml\nfeignhttp = { version = \"0.5\" }\n```\n\nThen add the following code:\n\n```rust\nuse feignhttp::get;\n\n#[get(\"https://api.github.com\")]\nasync fn github() -\u003e feignhttp::Result\u003cString\u003e {}\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    let r = github().await?;\n    println!(\"result: {}\", r);\n\n    Ok(())\n}\n```\n\nThe `get` attribute macro specifies get request, `feignhttp::Result\u003cString\u003e` specifies the return result.\nIt will send get request to `https://api.github.com` and receive a plain text body.\n\nUsing non-default HTTP backend:\n\n```toml\nfeignhttp = { version = \"0.5\", default-features = false, features = [\"isahc-client\"] }\n```\n\nThe `default-features = false` option disable default reqwest.\n\nFor more examples, click [here](./examples).\n\n## Documentation\n\nRead the [documentation](https://docs.rs/feignhttp) for more details.\n\n## License\n\nFeignHTTP is provided under the MIT license. See [LICENSE](./LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdxx%2Ffeignhttp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdxx%2Ffeignhttp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdxx%2Ffeignhttp/lists"}