{"id":20285640,"url":"https://github.com/marcisbee/radi-fetch","last_synced_at":"2026-03-06T12:31:17.968Z","repository":{"id":57332511,"uuid":"125059881","full_name":"Marcisbee/radi-fetch","owner":"Marcisbee","description":"Official HTTP client for Radi.js","archived":false,"fork":false,"pushed_at":"2023-04-05T09:13:44.000Z","size":34,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-10T20:14:18.153Z","etag":null,"topics":["ajax","client","fetch","http","radi","radijs"],"latest_commit_sha":null,"homepage":"https://radi.js.org","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/Marcisbee.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,"zenodo":null}},"created_at":"2018-03-13T13:56:57.000Z","updated_at":"2023-08-28T17:20:59.000Z","dependencies_parsed_at":"2025-04-11T08:58:48.322Z","dependency_job_id":"cc34f1c9-0e65-4801-820d-ca417bfbbab9","html_url":"https://github.com/Marcisbee/radi-fetch","commit_stats":null,"previous_names":["radi-js/radi-fetch"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Marcisbee/radi-fetch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marcisbee%2Fradi-fetch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marcisbee%2Fradi-fetch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marcisbee%2Fradi-fetch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marcisbee%2Fradi-fetch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Marcisbee","download_url":"https://codeload.github.com/Marcisbee/radi-fetch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marcisbee%2Fradi-fetch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30176131,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T11:48:51.886Z","status":"ssl_error","status_checked_at":"2026-03-06T11:48:51.460Z","response_time":250,"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":["ajax","client","fetch","http","radi","radijs"],"created_at":"2024-11-14T14:28:01.620Z","updated_at":"2026-03-06T12:31:17.590Z","avatar_url":"https://github.com/Marcisbee.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# radi-fetch\n\n`radi-fetch` is the official HTTP client for [Radi.js](https://radi.js.org). It deeply integrates with Radi for seamless application building.\n\n[![npm version](https://img.shields.io/npm/v/radi-fetch.svg?style=flat-square)](https://www.npmjs.com/package/radi-fetch)\n[![npm downloads](https://img.shields.io/npm/dm/radi-fetch.svg?style=flat-square)](https://www.npmjs.com/package/radi-fetch)\n[![gzip bundle size](http://img.badgesize.io/https://unpkg.com/radi-fetch@latest/dist/radi-fetch.min.js?compression=gzip\u0026style=flat-square)](https://unpkg.com/radi-fetch@latest/dist/radi-fetch.js)\n[![discord](https://dcbadge.vercel.app/api/server/a62gfaDW2e?style=flat-square)](https://discord.gg/a62gfaDW2e)\n\n\n## Installation\n\nTo install the stable version:\n\n```\nnpm install --save radi-fetch\n```\n\nThis assumes you are using [npm](https://www.npmjs.com/) as your package manager.  \n\nIf you're not, you can [access these files on unpkg](https://unpkg.com/radi-fetch/dist/), download them, or point your package manager to them.\n\n#### Browser Compatibility\n\n`radi-fetch` currently is compatible with browsers that support ES5.\n\n## Getting started\n\nHere is how it works. We start by initiating plugin for Radi `Radi.plugin(/* radi-fetch */, /* config */)`. Config here is optional, but we can define crucial parts of http client.\n\n```jsx\nimport RadiFetch from 'radi-fetch'\n\nRadi.plugin(RadiFetch)\n```\n\nor\n\n```jsx\nimport RadiFetch from 'radi-fetch'\n\nRadi.plugin(RadiFetch, {\n  /* We can define base url */\n  baseUrl: 'https://example.com',\n\n  /* We can define headers */\n  headers: {\n    'Authorization': 'key',\n  },\n\n  /* We can define dummy data that will be returned for requests made with radi-fetch */\n  dummy: true,           // Should return dummy data or use real requests\n  dummyTimeout: 1000,    // Dummy data latency simulation\n  dummyData: {           // Actual dummy data\n    get: {\n      '/api': {\n        hello: 'world',\n      },\n    },\n  },\n});\n```\n\nThat's it, we're ready to go. We can start fetching our api or whatever we want by using fetch by `$fetch[type](url, params, headers)` handle.\nResponse can be automatically parsed as JSON by using `.json()` method, or `.text()` for plain text response.\n\n```jsx\nclass MyComponent extends Radi.Component {\n  on() {\n    return {\n      mount() {\n        this.$fetch.get('/test')\n          .then(response =\u003e {\n            console.log(response.json())\n          })\n          .catch(error =\u003e {\n            console.log('Got some', error)\n          })\n      }\n    }\n  }\n}\n```\n\nFetch automatically sets loading state for any ongoing request. We can listen to them in radi using `$loading` handle.\n\n```jsx\n/* @jsx Radi.r */\n\nclass MyComponent extends Radi.Component {\n  view() {\n    return (\n      \u003cul\u003e\n        \u003cli\u003e/api is { this.$loading.state['/api'] ? 'loading' : 'ready' }\u003c/li\u003e\n        \u003cli\u003eNumber of active requests: { this.$loading.state.$count }\u003c/li\u003e\n        \u003cli\u003eAnything loading: { this.$loading.state.$any }\u003c/li\u003e\n      \u003c/ul\u003e\n    )\n  }\n}\n```\n\n## Stay In Touch\n\n- [Twitter](https://twitter.com/radi_js)\n- [Slack](https://join.slack.com/t/radijs/shared_invite/enQtMjk3NTE2NjYxMTI2LWFmMTM5NTgwZDI5NmFlYzMzYmMxZjBhMGY0MGM2MzY5NmExY2Y0ODBjNDNmYjYxZWYxMjEyNjJhNjA5OTJjNzQ)\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT)\n\nCopyright (c) 2018-present, Marcis (Marcisbee) Bergmanis\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcisbee%2Fradi-fetch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcisbee%2Fradi-fetch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcisbee%2Fradi-fetch/lists"}