{"id":14971486,"url":"https://github.com/bitgorust/fastify-http-client","last_synced_at":"2026-01-20T06:01:31.133Z","repository":{"id":57147753,"uuid":"175538083","full_name":"bitgorust/fastify-http-client","owner":"bitgorust","description":"urllib plugin for fastify","archived":false,"fork":false,"pushed_at":"2024-10-08T01:29:17.000Z","size":50,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-25T06:07:12.398Z","etag":null,"topics":["curl","fastify","http-client","httpclient","request","urllib"],"latest_commit_sha":null,"homepage":"","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/bitgorust.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}},"created_at":"2019-03-14T03:00:14.000Z","updated_at":"2024-10-08T01:29:21.000Z","dependencies_parsed_at":"2025-02-11T19:46:38.131Z","dependency_job_id":null,"html_url":"https://github.com/bitgorust/fastify-http-client","commit_stats":null,"previous_names":["kenuyx/fastify-http-client"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/bitgorust/fastify-http-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitgorust%2Ffastify-http-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitgorust%2Ffastify-http-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitgorust%2Ffastify-http-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitgorust%2Ffastify-http-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitgorust","download_url":"https://codeload.github.com/bitgorust/fastify-http-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitgorust%2Ffastify-http-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28597087,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T02:08:49.799Z","status":"ssl_error","status_checked_at":"2026-01-20T02:08:44.148Z","response_time":117,"last_error":"SSL_read: 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":["curl","fastify","http-client","httpclient","request","urllib"],"created_at":"2024-09-24T13:45:16.585Z","updated_at":"2026-01-20T06:01:31.119Z","avatar_url":"https://github.com/bitgorust.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fastify-http-client\n\n[![NPM](https://nodei.co/npm/fastify-http-client.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/fastify-http-client/)\n\n[![Build Status](https://travis-ci.org/kenuyx/fastify-http-client.svg?branch=master)](https://travis-ci.org/kenuyx/fastify-http-client)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/)\n[![codecov](https://codecov.io/gh/kenuyx/fastify-http-client/branch/master/graph/badge.svg)](https://codecov.io/gh/kenuyx/fastify-http-client)\n[![Known Vulnerabilities](https://snyk.io/test/github/kenuyx/fastify-http-client/badge.svg?targetFile=package.json)](https://snyk.io/test/github/kenuyx/fastify-http-client?targetFile=package.json)\n[![Greenkeeper badge](https://badges.greenkeeper.io/kenuyx/fastify-http-client.svg)](https://greenkeeper.io/)\n\nA plugin for [Fastify](http://fastify.io/) that adds support for sending HTTP(s) requests.\n\nUnder the hood [urllib](https://github.com/node-modules/urllib) is used, the options passed to `register` will be used as the default arguments while creating the urllib client.\n\n## Install\n\n```shell\nnpm i fastify-http-client --save\n```\n\n## Usage\n\nJust add it to the project generated via [fastify-cli](https://github.com/fastify/fastify-cli) with `register` in `app.js` as below.\n\nYou can access the [urllib](https://github.com/node-modules/urllib) `HttpClient` instance via `fastify.httpclient`, which can be used to send HTTP(s) requests via methods `curl` / `request` / `requestWithCallback` / `requestThunk`. You can also send HTTP(s) requests directly via `fastify.curl`, which is the same function as `request` / `curl` in [urllib](https://github.com/node-modules/urllib).\n\n```js\n'use strict'\n\nmodule.exports = function (fastify, opts, next) {\n  fastify.register(require('fastify-http-client'))\n\n  // request via httpclient\n  fastify.httpclient.request('https://nodejs.org/en/', (err, body) =\u003e {\n    console.log('body size: %d', body.length)\n  })\n\n  // request via curl method\n  fastify.curl('https://nodejs.org/en/').then((result) =\u003e {\n    console.log('status: %s, body size: %d, headers: %j',\n      result.res.statusCode, result.data.length, result.res.headers)\n  }).catch((err) =\u003e {\n    console.error(err)\n  })\n\n  next()\n}\n```\n\nYou may also supply an existing [urllib](https://github.com/node-modules/urllib) `HttpClient` instance by passing an options object with the client property set to the instance.\n\n```js\n'use strict'\n\nconst urllib = require('urllib')\n\nmodule.exports = function (fastify, opts, next) {\n  fastify.register(require('fastify-http-client'), {\n    client: urllib.create()\n  })\n\n  // ...\n\n  next()\n}\n```\n\n## Options\n\nBesides `client` property sampled above, properties listed in [urllib / API Doc / Method / Arguments](https://github.com/node-modules/urllib#arguments) are all supported in the options object passed to `register`.\n\n## License\n\nLicensed under [MIT](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitgorust%2Ffastify-http-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitgorust%2Ffastify-http-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitgorust%2Ffastify-http-client/lists"}