{"id":14483637,"url":"https://github.com/MyUnisoft/httpie","last_synced_at":"2025-08-30T04:31:39.771Z","repository":{"id":42629604,"uuid":"393953927","full_name":"MyUnisoft/httpie","owner":"MyUnisoft","description":"A modern and light Node.js http client 🐢🚀 (built with undici under the hood). ","archived":false,"fork":false,"pushed_at":"2024-08-03T05:49:05.000Z","size":790,"stargazers_count":14,"open_issues_count":1,"forks_count":4,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-08-03T06:43:21.446Z","etag":null,"topics":["client","http","httpie","node","nodejs","request","undici"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/MyUnisoft.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-08T12:27:31.000Z","updated_at":"2024-08-03T05:49:03.000Z","dependencies_parsed_at":"2024-03-14T18:56:51.924Z","dependency_job_id":"d6af1297-4468-4ea3-a1ca-f72f473b2fe4","html_url":"https://github.com/MyUnisoft/httpie","commit_stats":{"total_commits":90,"total_committers":4,"mean_commits":22.5,"dds":"0.15555555555555556","last_synced_commit":"bea7de74b378d1999c8840671b85ea8aef53cd2a"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MyUnisoft%2Fhttpie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MyUnisoft%2Fhttpie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MyUnisoft%2Fhttpie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MyUnisoft%2Fhttpie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MyUnisoft","download_url":"https://codeload.github.com/MyUnisoft/httpie/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":217593012,"owners_count":16201561,"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":["client","http","httpie","node","nodejs","request","undici"],"created_at":"2024-09-03T00:01:56.233Z","updated_at":"2024-09-03T00:06:28.824Z","avatar_url":"https://github.com/MyUnisoft.png","language":"TypeScript","readme":"\n\u003cp align=\"center\"\u003e\u003ch1 align=\"center\"\u003e\n  Httpie\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  A modern and light Node.js http client 🐢🚀.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/MyUnisoft/httpie\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/package-json/v/MyUnisoft/httpie?style=flat-square\" alt=\"npm version\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/MyUnisoft/httpie\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/license/MyUnisoft/httpie?style=flat-square\" alt=\"license\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://api.securityscorecards.dev/projects/github.com/MyUnisoft/httpie\"\u003e\n      \u003cimg src=\"https://api.securityscorecards.dev/projects/github.com/MyUnisoft/httpie/badge\" alt=\"ossf scorecard\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/MyUnisoft/httpie/actions?query=workflow%3A%22Node.js+CI%22\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/MyUnisoft/httpie/node.js.yml\" alt=\"github ci workflow\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/MyUnisoft/httpie\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/languages/code-size/MyUnisoft/httpie?style=flat-square\" alt=\"size\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n## 📢 About\n\nThe package is inspired by lukeed [httpie](https://github.com/lukeed/httpie) (The use is relatively similar). This package use new Node.js http client [undici](https://github.com/nodejs/undici) under the hood.\n\n## 🔬 Features\n\n- Automatically parse based on the `content-type`.\n- Automatically decompress based on the `content-encoding`.\n- Includes aliases for common HTTP verbs: `get`, `post`, `put`, `patch`, and `del`.\n- Able to automatically detect domains and paths to assign the right Agent (use a LRU cache to avoid repetitive computation).\n- Allows to use an accurate rate-limiter like `p-ratelimit` with the `limit` option.\n- Built-in retry mechanism with **custom policies**.\n- Safe error handling with Rust-like [Result](https://github.com/OpenAlly/npm-packages/tree/main/src/result).\n\nThanks to undici:\n\n- Support [HTTP redirections](https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections) with the `maxRedirections` argument.\n- Implement high-level API for undici **stream** and **pipeline** method.\n- High performance (see [benchmarks](https://undici.nodejs.org/#/?id=benchmarks)).\n- Work well with **newest** Node.js API [AbortController](https://nodejs.org/dist/latest-v16.x/docs/api/globals.html#globals_class_abortcontroller) to cancel http request.\n\nLight with seriously maintained dependencies:\n\n![](./docs/images/nodesecure.PNG)\n\n## 🚧 Requirements\n- [Node.js](https://nodejs.org/en/) version 20 or higher\n\n## 🚀 Getting Started\n\nThis package is available in the Node Package Repository and can be easily installed with [npm](https://docs.npmjs.com/getting-started/what-is-npm) or [yarn](https://yarnpkg.com).\n\n```bash\n$ npm i @myunisoft/httpie\n# or\n$ yarn add @myunisoft/httpie\n```\n\n## 📚 Usage example\n\nThe MyUnisoft httpie client is very similar to lukeed httpie http client.\n\n```js\nimport * as httpie from \"@myunisoft/httpie\";\n\ntry {\n  const { data } = await httpie.get(\"https://jsonplaceholder.typicode.com/posts\");\n  console.log(data);\n  \n  const response = await httpie.post(\"https://jsonplaceholder.typicode.com/posts\", {\n    body: {\n      title: \"foo\",\n      body: \"bar\",\n      userId: 1\n    }\n  });\n\n  console.log(response.statusCode);\n  console.log(response.statusMessage);\n  console.log(response.data);\n}\ncatch (error) {\n  console.log(error.message);\n  console.log(error.statusCode);\n  console.log(error.headers);\n  console.log(error.data);\n}\n```\n\nSince v2.0.0 you can also use the `safe` prefix API to get a `Promise\u003cResult\u003cT, E\u003e\u003e`\n\n```ts\nimport * as httpie from \"@myunisoft/httpie\";\n\nconst response = (await httpie.safePost(\"https://jsonplaceholder.typicode.com/posts\", {\n  body: {\n    title: \"foo\",\n    body: \"bar\",\n    userId: 1\n  }\n}))\n  .map((response) =\u003e response.data)\n  .mapErr((error) =\u003e new Error(\"a message here!\", { cause: error.data }));\n  .unwrap();\n```\n\n\u003e 👀 For more examples of use please look at the root folder **examples**.\n\n## 📜 API\n\n- [Request API](./docs/request.md)\n- [Retry API](./docs/retry.md)\n- [Work and manage Agents](./docs/agents.md)\n\n## Error handling\n\nRead the [error documentation](./docs/errors.md).\n\n\n## Contributors ✨\n\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://www.linkedin.com/in/thomas-gentilhomme/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/4438263?v=4?s=100\" width=\"100px;\" alt=\"Gentilhomme\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eGentilhomme\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/MyUnisoft/httpie/commits?author=fraxken\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/MyUnisoft/httpie/commits?author=fraxken\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"https://github.com/MyUnisoft/httpie/pulls?q=is%3Apr+reviewed-by%3Afraxken\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e \u003ca href=\"#security-fraxken\" title=\"Security\"\u003e🛡️\u003c/a\u003e \u003ca href=\"https://github.com/MyUnisoft/httpie/issues?q=author%3Afraxken\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/PierreDemailly\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/39910767?v=4?s=100\" width=\"100px;\" alt=\"PierreDemailly\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003ePierreDemailly\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/MyUnisoft/httpie/commits?author=PierreDemailly\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/MyUnisoft/httpie/commits?author=PierreDemailly\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"http://sofiand.github.io/portfolio-client/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/39944043?v=4?s=100\" width=\"100px;\" alt=\"Yefis\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eYefis\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/MyUnisoft/httpie/commits?author=SofianD\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/MyUnisoft/httpie/issues?q=author%3ASofianD\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\n## License\nMIT\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMyUnisoft%2Fhttpie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMyUnisoft%2Fhttpie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMyUnisoft%2Fhttpie/lists"}