我看到请求对象的headers
属性中有一个'cookie'键,但没有别的。
我无法在文档中找到与cookie相关的任何内容。
module.exports = function (context, req) {
context.res = {
body: "Something"
};
// how do I send cookies ??
context.done();
}
答案 0 :(得分:0)
在标题中使用Set-Cookie应该有效。
例如:
var exdate = new Date(2018, 5, 1);
context.res = {
body: "<b> this totally works</b> <i> nice</i>",
status: 201,
headers: {
'Set-Cookie': 'mycookie=test; Expires=' + exdate.toUTCString() + ';'
}
};
context.done();