A flexible, modular REST client built for ease-of-use and resilience
npm install @bbc/http-transport --save
const url = '';const client = ;const res = await client;if resstatusCode === 200console;
For more examples and API details, see API documentation
Types are included in this project, and they also work with plugins.
Just pass the types that your plugin will add to
context as a generic. This will be overlayed on top of any types added by previous plugins in the chain.
;.useaddSessionData.use.use.geturl.asResponse;console.logres.random; // number
If you don't want to type your plugin, simply use
any as the type. This is not recomemnded though as it means all plugins later in the chain will loose the types too, because they have no idea what changes were made.
To generate a test coverage report:
npm run coverage