0

基本上,我试图从 HTTP 触发的 azure 函数中获取 excel 作为响应

response = func.HttpResponse(data, mimetype='application/vnd.ms-excel')
response['Content-Disposition'] = 'attachment; filename="test.xlsx"'
return response

但没有 Content -Disposition 的标题

4

1 回答 1

1

请尝试使用此代码:

response = func.HttpResponse(fileContent, headers={'Content-Disposition':'attachment; filename="test.xlsx"'}, mimetype='application/vnd.ms-excel')
于 2021-04-27T02:58:08.933 回答