Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 329 Bytes

README.md

File metadata and controls

23 lines (16 loc) · 329 Bytes

koa2-request

koa2的request库封装,支持async和await写法

安装

npm install koa2-request

使用方法

var koa2Req = require('koa2-request');

app.use(async(ctx, next) => {
	// request选项
	var res = await koa2Req('http://www.baidu.com');
	ctx.body = res.body;
});