Closed sm2017 closed 5 years ago
https://github.com/koajs/koa/blob/master/lib/response.js#L140
try:(don't work)
this.ctx.status = 202;
this.ctx.body = '';
update:
it seems will use ctx.message
as default if you don't provide body
, maybe should dig into Koa or Node api.
@atian25 see https://github.com/koajs/koa/issues/1314#issuecomment-470594686
What you think?
try
this.ctx.status = 202;
this.ctx.body = new Buffer(0);
this.ctx.status = 202;
this.ctx.body = Buffer.from('');
How can I have
zero length
body? Myctx.status
is202
=Accepted
, I don't set ctx.body but egg set it as empty object , for 204 egg has no body , but I want to set status 202 as the task is just accepted and will done later@see https://greenbytes.de/tech/webdav/rfc7230.html#message.body