egg-got
Important:
still in develop, do not use in production.
HTTP request library got plugin for eggjs.
Install
$ npm i egg-got
Usage
// {app_root}/config/plugin.jsexportsgot = enable: true package: 'egg-got';
Configuration
// {app_root}/config/config.default.jsexportsgot = // ...;
If you want to save got
log, please define a custom logger named gotLogger
, this name you can rename in got.logger.name
.
// custom loggerexportscustomLogger = gotLogger: // ... ;
Options:
You can use got options in root property, but exclude hooks
, you should got.extend
it yourself.
logger.name
Type: string
The custom logger name.
logger.formatter
Type: Function
See got hooks for more detail.
For example:
/** * @param * @param * @param * @param * @param * ... */ { }