{"id":22204712,"url":"https://github.com/opensource-direct/react-native-axios","last_synced_at":"2025-03-25T02:45:15.132Z","repository":{"id":167000629,"uuid":"620644872","full_name":"opensource-direct/react-native-axios","owner":"opensource-direct","description":"React Native Axios Consume API by HTTP Protocol","archived":false,"fork":false,"pushed_at":"2023-03-29T07:45:21.000Z","size":403,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-30T03:45:35.684Z","etag":null,"topics":["api","axios","http","react-native"],"latest_commit_sha":null,"homepage":"","language":"Java","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/opensource-direct.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}},"created_at":"2023-03-29T05:02:08.000Z","updated_at":"2024-07-05T08:15:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"1107104c-6349-42ca-a6ed-e4cc1056f4ab","html_url":"https://github.com/opensource-direct/react-native-axios","commit_stats":null,"previous_names":["aspsptyd/react-native-axios","opensource-direct/react-native-axios"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensource-direct%2Freact-native-axios","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensource-direct%2Freact-native-axios/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensource-direct%2Freact-native-axios/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensource-direct%2Freact-native-axios/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opensource-direct","download_url":"https://codeload.github.com/opensource-direct/react-native-axios/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245388759,"owners_count":20607163,"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":["api","axios","http","react-native"],"created_at":"2024-12-02T17:19:19.979Z","updated_at":"2025-03-25T02:45:15.113Z","avatar_url":"https://github.com/opensource-direct.png","language":"Java","readme":"## react-native-axios\nReact Native Axios Consume API by HTTP Protocol\n\n## Get Data News API in Console Log\nUntuk fetch data dari API kita Perlu Menginstallkan `Axios`\n\n```shell\n~/Desktop/react-native/ReactNativeAxios ⌚ 11:50:48\n$ npm install axios \n```\n\n\u003cimg width=\"984\" alt=\"Screen Shot 2023-03-29 at 12 43 47\" src=\"https://user-images.githubusercontent.com/98740335/228437589-b6c69276-2609-40bc-a5c1-1fc2dc6f0167.png\"\u003e\n\nkemudian pada App.tsx rename menjadi App.js, lalu ubah isinya seperti tampak pada kodingan dibawah ini\n\n```js\nimport { StyleSheet, Text, View } from 'react-native'\nimport React, { useEffect } from 'react'\nimport axios from 'axios'\n\nexport default function App() {\n  console.info('Ini coba ambil data');\n\n  const getData = async () =\u003e {\n    try {\n      const res = await axios.get('https://newsapi.org/v2/top-headlines', {\n        params: {\n          country: 'id',\n          category: 'technology',\n          apiKey: '87d43d69278f492783fddbd07988ad8b'\n        }\n      })\n\n      console.info('Get Data New : ', res)\n    } catch (error) {\n      console.error(error.message)\n    }\n  };\n\n  useEffect(() =\u003e {\n    getData()\n  }, [])\n\n  return (\n    \u003cView\u003e\n      \u003cText\u003eApp\u003c/Text\u003e\n    \u003c/View\u003e\n  )\n}\n\nconst styles = StyleSheet.create({})\n```\n\nrunning kemudian coba debug aplikasi, akses log pada `React Native Debugger` inspect element kemudian arahkan ke bagian `console`\n\n\u003cimg width=\"1680\" alt=\"Screen Shot 2023-03-29 at 12 46 10\" src=\"https://user-images.githubusercontent.com/98740335/228437971-8f232143-605f-4b29-93c5-c95be7ee8be9.png\"\u003e\n\nPreferensi Library yang Diinstallkan \n\n- [x] https://www.npmjs.com/package/axios","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopensource-direct%2Freact-native-axios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopensource-direct%2Freact-native-axios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopensource-direct%2Freact-native-axios/lists"}