{"id":22351909,"url":"https://github.com/screwdriver-cd/request","last_synced_at":"2025-07-30T07:31:56.880Z","repository":{"id":43654677,"uuid":"388933826","full_name":"screwdriver-cd/request","owner":"screwdriver-cd","description":"Wrapper around got pkg to define a simple interface for http requests","archived":false,"fork":false,"pushed_at":"2022-12-01T00:42:22.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":3,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-04-24T18:42:13.546Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/screwdriver-cd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-23T21:45:19.000Z","updated_at":"2022-02-25T19:28:23.000Z","dependencies_parsed_at":"2023-01-22T09:15:39.379Z","dependency_job_id":null,"html_url":"https://github.com/screwdriver-cd/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/screwdriver-cd%2Frequest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/screwdriver-cd%2Frequest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/screwdriver-cd%2Frequest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/screwdriver-cd%2Frequest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/screwdriver-cd","download_url":"https://codeload.github.com/screwdriver-cd/request/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228106386,"owners_count":17870438,"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-04T12:16:29.829Z","updated_at":"2024-12-04T12:16:30.430Z","avatar_url":"https://github.com/screwdriver-cd.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# request\n[![Version][npm-image]][npm-url] ![Downloads][downloads-image] [![Build Status][status-image]][status-url] [![Open Issues][issues-image]][issues-url] ![License][license-image]\n\n\u003e Wrapper around [got pkg](https://github.com/sindresorhus/got) to define a simple interface for http requests\n\n## Usage\n\n```bash\nnpm install screwdriver-request\n```\n\nExample:\n```javascript\nconst Hoek = require('@hapi/hoek');\nconst logger = require('logger');\nconst request = require('screwdriver-request');\n\nasync _addPrComment({ comment, prNum, scmUri }) {\n    try {\n        const pullRequestComment = await request({\n            method: 'POST',\n            url: `https://gitlab.com/v4/projects/${repoId}/merge_requests/${prNum}/notes`,\n            json: {\n                body: 'This is a comment'\n            },\n            context: {\n                token: this.config.commentUserToken,\n                caller: 'createPullRequestComment'\n            },\n            timeout: 15000\n        });\n        \n        return {\n            commentId: Hoek.reach(pullRequestComment, 'body.id'),\n            createTime: Hoek.reach(pullRequestComment, 'body.created_at'),\n            username: Hoek.reach(pullRequestComment, 'body.author.username')\n        };\n    } catch (err) {\n            logger.error('Failed to addPRComment: ', err);\n\n            return null;\n        }\n    }\n}\n\n```\n## Testing\n\n```bash\nnpm test\n```\n\n## License\n\nCode licensed under the BSD 3-Clause license. See LICENSE file for terms.\n\n[npm-image]: https://img.shields.io/npm/v/screwdriver-request.svg\n[npm-url]: https://npmjs.org/package/screwdriver-request\n[downloads-image]: https://img.shields.io/npm/dt/screwdriver-request.svg\n[license-image]: https://img.shields.io/npm/l/screwdriver-request.svg\n[issues-image]: https://img.shields.io/github/issues/screwdriver-cd/request.svg\n[issues-url]: https://github.com/screwdriver-cd/request/issues\n[status-image]: https://cd.screwdriver.cd/pipelines/7717/badge\n[status-url]: https://cd.screwdriver.cd/pipelines/7717\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscrewdriver-cd%2Frequest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscrewdriver-cd%2Frequest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscrewdriver-cd%2Frequest/lists"}