{"id":40674356,"url":"https://github.com/humayunkabir/react-axios-request","last_synced_at":"2026-01-21T09:38:25.834Z","repository":{"id":42919199,"uuid":"247289108","full_name":"humayunkabir/react-axios-request","owner":"humayunkabir","description":"Promise based HTTP client for ReactJS","archived":false,"fork":false,"pushed_at":"2023-01-05T10:00:25.000Z","size":331,"stargazers_count":0,"open_issues_count":9,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-02T16:36:11.990Z","etag":null,"topics":["axios","promise","react","react-axios","reactjs","request"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/humayunkabir.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-03-14T14:12:40.000Z","updated_at":"2020-03-18T10:54:13.000Z","dependencies_parsed_at":"2023-02-04T00:16:10.434Z","dependency_job_id":null,"html_url":"https://github.com/humayunkabir/react-axios-request","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/humayunkabir/react-axios-request","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humayunkabir%2Freact-axios-request","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humayunkabir%2Freact-axios-request/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humayunkabir%2Freact-axios-request/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humayunkabir%2Freact-axios-request/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/humayunkabir","download_url":"https://codeload.github.com/humayunkabir/react-axios-request/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humayunkabir%2Freact-axios-request/sbom","scorecard":{"id":473285,"data":{"date":"2025-08-11","repo":{"name":"github.com/humayunkabir/react-axios-request","commit":"171525dc73bc78c1486119f1f0c763056bd7c223"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/14 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":"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":"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":"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":"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":"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":"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":"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":"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":"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"}},{"name":"Vulnerabilities","score":0,"reason":"24 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-4w2v-q235-vp99","Warn: Project is vulnerable to: GHSA-cph5-m8f7-6c5x","Warn: Project is vulnerable to: GHSA-wf5p-g6vw-rhxx","Warn: Project is vulnerable to: GHSA-jr5f-v2jv-69x6","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-74fj-2j2h-c42q","Warn: Project is vulnerable to: GHSA-pw2r-vq6v-hr8c","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T14:32:52.523Z","repository_id":42919199,"created_at":"2025-08-19T14:32:52.523Z","updated_at":"2025-08-19T14:32:52.523Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28631409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["axios","promise","react","react-axios","reactjs","request"],"created_at":"2026-01-21T09:38:25.114Z","updated_at":"2026-01-21T09:38:25.825Z","avatar_url":"https://github.com/humayunkabir.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Axios Request\n\nPromise based HTTP client for ReactJS. [React Axios Request](https://github.com/humayunkabir/react-axios-request/) use [Axios](https://github.com/axios/axios) under the hood.\n\n```\nnpm i react-axios-request\n```\n\nor\n\n```\nyarn add react-axios-request\n```\n\nYou can perform these requests:\n\n- `get`\n- `post`\n- `patch`\n- `put`\n- `delete`\n\n### Example\n\n\u003c!-- Let's start with the basic example.\n\n```\nimport React from \"react\";\nimport { Request } from \"react-axios-request\";\nimport { apiBaseUrl } from \"./config\"\n\nconst UserUpdate = () =\u003e {\n  const [name, setName] = useState(\"\");\n  const [age, setAge] = useState(\"\");\n\n  const cleanState = () =\u003e {\n    setName(\"\");\n    setAge(\"\");\n  };\n\n  return (\n    \u003cRequest\n      method=\"post\"\n      base={apiBaseUrl}\n      route=\"users/1\"\n      body={{ name, age }}\n    \u003e\n      {({ data, error, requestCallback }) =\u003e {\n\n\n        return (\n          \u003cform\n            onSubmit={e =\u003e {\n              e.preventDefault();\n              login(requestCallback, cleanState);\n            }}\n          \u003e\n            \u003cinput\n              id=\"username\"\n              value={username}\n              onChange={({ target }) =\u003e setUsername(target.value)}\n            /\u003e\n            \u003cinput\n              id=\"password\"\n              type=\"password\"\n              value={password}\n              onChange={({ target }) =\u003e setPassword(target.value)}\n            /\u003e\n            \u003cbutton disabled={!username || !password}\u003e\n              Login\n            \u003c/button\u003e\n\n            {error \u0026\u0026 (\n              \u003cp\u003e\n                Username and/or Passowrd do(es)n't match. Please try again.\n                \u003cbr /\u003e\n                \u003csmall\u003e{error.message}\u003c/small\u003e\n              \u003c/p\u003e\n            )}\n          \u003c/form\u003e\n        )\n      }}\n    \u003c/Request\u003e\n  )\n}\n\nexport default UserUpdate\n``` --\u003e\n\nLet's create a `Login` compoentet using `Request`\n\n#### Authentication Hook\n\n```\nconst useAuth = () =\u003e {\n  const login = async (requestCallback, loginCallback) =\u003e {\n    const response = await requestCallback() // Assume we get an access token in response\n\n    if (response?.data) {\n       const { accessToken, ...rest } = response.data;\n      // Do whatever you want with this accessToken\n      localStorage.setItem(\"accessToken\", accessToken)\n\n      // Now calling the callback which is passed from the Login component\n      !!loginCallback \u0026\u0026 loginCallback()\n    }\n  };\n\n  const logout = () =\u003e {\n    // Logout code\n    localStorage.removeItem(\"accessToken\")\n  };\n\n  return { login, logout }\n}\n```\n\n#### Login Component\n\n```\nimport React, { useState } from \"react\";\nimport { Request } from \"react-axios-request\";\n\nconst Login = () =\u003e {\n  const { login } = useAuth();\n\n  const [username, setUsername] = useState(\"\");\n  const [password, setPassword] = useState(\"\");\n\n  const cleanState = () =\u003e {\n    setUsername(\"\");\n    setPassword(\"\");\n  };\n\n  return (\n    \u003cRequest\n      method=\"post\"\n      base={apiBaseUrl}\n      route=\"auth/login\"\n      body={{ username, password }}\n    \u003e\n      {({ error, requestCallback }) =\u003e (\n        \u003cform\n          onSubmit={e =\u003e {\n            e.preventDefault();\n            login(requestCallback, cleanState);\n          }}\n        \u003e\n          \u003cinput\n            id=\"username\"\n            value={username}\n            onChange={({ target }) =\u003e setUsername(target.value)}\n          /\u003e\n          \u003cinput\n            id=\"password\"\n            type=\"password\"\n            value={password}\n            onChange={({ target }) =\u003e setPassword(target.value)}\n          /\u003e\n          \u003cbutton disabled={!username || !password}\u003e\n            Login\n          \u003c/button\u003e\n\n          {error \u0026\u0026 (\n            \u003cp\u003e\n              Username and/or Passowrd do(es)n't match. Please try again.\n              \u003cbr /\u003e\n              \u003csmall\u003e{error.message}\u003c/small\u003e\n            \u003c/p\u003e\n          )}\n        \u003c/form\u003e\n      )}\n    \u003c/Request\u003e\n  )\n};\n\nexport default Login;\n```\n\n#### Get Request\n\nIn `Request` component, `default` method is `get`. To make a `get` request, you don't have to pass `method='get'` to `Request` component.\n\n```\nimport React from \"react\";\nimport { Request } from \"react-axios-request\";\nimport { apiBaseUrl } from \"./config\";\n\nconst requestConfig = {\n  headers: {\n    \"Content-Type\": \"application/json\",\n    Authorization: `Bearer ${localStorage.getItem(\"accessToken\")}`\n  }\n};\n\nconst App = () =\u003e (\n  \u003cRequest base={apiBaseUrl} config={requestConfig}\u003e\n    {({ data, error, requestCallback }) =\u003e (\n      \u003ch4\u003e{data?.title}\u003c/h4\u003e\n      \u003cp\u003e{data?.description}\u003c/p\u003e\n    )}\n  \u003c/Request\u003e\n);\n\nexport default App;\n```\n\n### Configuration\n\nMake a component `ReactAxiosRequest` and use this component insted of `Request`. Now you don't have to pass `base` and `config` everytime you use this component like you have to pass in `Request` component.\n\n```\nimport React from \"react\";\nimport { Request } from \"react-axios-request\";\nimport { apiBaseUrl } from \"./config\";\n\nconst ReactAxiosRequest = props =\u003e {\n  const requestConfig = {\n    headers: {\n      \"Content-Type\": \"application/json\",\n      Authorization: `Bearer ${localStorage.getItem(\"accessToken\")}`\n    }\n  };\n\n  return \u003cRequest base={apiBaseUrl} config={requestConfig} {...props} /\u003e;\n};\n\nexport default ReactAxiosRequest;\n```\n\n**Please report bugs and contribute at github:**\n\n- [Repository](https://github.com/humayunkabir/react-axios-request)\n- [Issues](https://github.com/humayunkabir/react-axios-request/issues)\n- [Projects](https://github.com/humayunkabir/react-axios-request/projects)\n\nPowered by: [react-axios-request](https://github.com/humayunkabir/react-axios-request)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhumayunkabir%2Freact-axios-request","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhumayunkabir%2Freact-axios-request","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhumayunkabir%2Freact-axios-request/lists"}