{"id":22230181,"url":"https://github.com/serayaeryn/simple-json-request","last_synced_at":"2025-03-25T08:44:59.209Z","repository":{"id":31659643,"uuid":"128542237","full_name":"SerayaEryn/simple-json-request","owner":"SerayaEryn","description":"A simple json request module with Promise support.","archived":false,"fork":false,"pushed_at":"2023-02-07T04:00:58.000Z","size":41,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-05T00:06:04.136Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SerayaEryn.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":"2018-04-07T15:33:26.000Z","updated_at":"2020-10-23T06:16:37.000Z","dependencies_parsed_at":"2023-02-19T15:01:07.627Z","dependency_job_id":null,"html_url":"https://github.com/SerayaEryn/simple-json-request","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SerayaEryn%2Fsimple-json-request","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SerayaEryn%2Fsimple-json-request/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SerayaEryn%2Fsimple-json-request/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SerayaEryn%2Fsimple-json-request/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SerayaEryn","download_url":"https://codeload.github.com/SerayaEryn/simple-json-request/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245431708,"owners_count":20614182,"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-12-03T01:14:35.404Z","updated_at":"2025-03-25T08:44:59.187Z","avatar_url":"https://github.com/SerayaEryn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# simple-json-request\n\n![Build Status](https://github.com/SerayaEryn/simple-json-request/workflows/ci/badge.svg)\n[![Coverage Status](https://coveralls.io/repos/github/SerayaEryn/simple-json-request/badge.svg?branch=master)](https://coveralls.io/github/SerayaEryn/simple-json-request?branch=master)\n[![NPM version](https://img.shields.io/npm/v/simple-json-request.svg?style=flat)](https://www.npmjs.com/package/simple-json-request)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\nA simple module to make json requests with Promise support, that wraps around the [simple-get](https://github.com/feross/simple-get) module.\n\n## Installation\n```\nnpm install simple-json-request\n```\n## Usage\n\n```js\nconst request = require('simple-json-request')\n\nrequest.request({\n  method: 'GET',\n  url: 'http://example.com'\n})\n  .then((data) =\u003e {\n    // ...\n  })\n  .catch((error) =\u003e {\n    // ...\n  });\n```\n## API\n### request(options)\nExecutes a request with the specified `options`. `options` may be a string representing a url. Returns a promise that either resolves the parsed data or rejects with an error.\n### get(options)\nA convenience function that uses the method `GET` by default.\n### post(options)\nA convenience function that uses the method `POST` by default.\n### put(options)\nA convenience function that uses the method `PUT` by default.\n### delete(options)\nA convenience function that uses the method `DELETE` by default.\n### head(options)\nA convenience function that uses the method `HEAD` by default.\n### patch(options)\nA convenience function that uses the method `PATCH` by default.\n### options\n\n#### url\n\nThe url to request.\n\n#### method\n\nThe http method. Supports `GET`, `POST`, `PUT`, `PATCH`, `HEAD` and `DELETE`.\n\n#### timeout\n\nAllows to set a socket timeout in milliseconds.\n\n#### headers\n\nAllows to pass headers with the request.\n\n#### body\n\nThe body of a post request.\n\n#### form\n\nThe form data of a post request with `Content-Type` : `application/x-www-form-urlencoded`.\n\n#### readTimeout\n\nAllows to set a read timeout in milliseconds.\n\n#### maxRedirects\n\nThe maximum number of redirects to follow in a request. Defaults to `10`.\n\n### parser\n\nAllows to specify a custom json parser like [turbo-json-parse](https://github.com/mafintosh/turbo-json-parse).\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserayaeryn%2Fsimple-json-request","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserayaeryn%2Fsimple-json-request","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserayaeryn%2Fsimple-json-request/lists"}