{"id":17349198,"url":"https://github.com/co2-git/reactors-http-request","last_synced_at":"2025-03-27T11:44:24.363Z","repository":{"id":68259619,"uuid":"61184976","full_name":"co2-git/reactors-http-request","owner":"co2-git","description":null,"archived":false,"fork":false,"pushed_at":"2016-07-18T01:30:15.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T16:23:15.653Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/co2-git.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":"2016-06-15T06:58:00.000Z","updated_at":"2016-06-15T07:00:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"556478d3-ea62-443c-9377-12db4d56afbd","html_url":"https://github.com/co2-git/reactors-http-request","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/co2-git%2Freactors-http-request","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/co2-git%2Freactors-http-request/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/co2-git%2Freactors-http-request/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/co2-git%2Freactors-http-request/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/co2-git","download_url":"https://codeload.github.com/co2-git/reactors-http-request/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245841689,"owners_count":20681184,"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":[],"created_at":"2024-10-15T16:55:01.829Z","updated_at":"2025-03-27T11:44:24.342Z","avatar_url":"https://github.com/co2-git.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"reactors-http-request\n===\n\n`reactors-http-request` negotiates HTTP(s) transactions for [reactors](https://github.com/co2-git/reactors).\n\nMost of the times you are fine using the `Fetch` API. It is supported both by React Native for Android and iOS and is a HTML spec - so it works both for web and desktop. Yet, for web and desktop, the fetch API won't handle requests to other domains. For these cases, you can use `reactors-http-request`.\n\nIt will then use `superagent`. We try to add as much support as possible to various cases such as streaming or cache handling.\n\n# Install\n\n```bash\nnpm install --save reactors-http-request\n```\n\n# Usage\n\n```javascript\nrequest(url: string, options?: Object)\n```\n\n```javascript\nimport request from 'reactors-http-request';\n\nasync function createNewFoo(url, foo) {\n  const res = await request(url, {method: 'POST', payload: foo});\n  const {ok, body, error} = res;\n  return ok ? body : error;\n}\n```\n\n# HTTP Methods\n\n```javascript\nrequest(url, {method: 'POST', payload: {foo: 1}});\n```\n\n# Headers\n\nYou can set headers as such:\n\n```javascript\nrequest(url, {headers: {['X-HEADER']: 'foo'}});\n```\n\n# JSON detection\n\nJSON is detected for both requests (so you don't need to set the Content-Type header) and for responses (so you don't need to parse the text - it is already in JSON).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fco2-git%2Freactors-http-request","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fco2-git%2Freactors-http-request","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fco2-git%2Freactors-http-request/lists"}