基本上,我正在尝试从 HTTP 触发的 azure 函数获取 Excel 作为响应
response = func.HttpResponse(data, mimetype='application/vnd.ms-excel')
response['Content-Disposition'] = 'attachment; filename="test.xlsx"'
return response
但是没有 Content -Disposition 的 header
最佳答案
请尝试使用此代码:
response = func.HttpResponse(fileContent, headers={'Content-Disposition':'attachment; filename="test.xlsx"'}, mimetype='application/vnd.ms-excel')
关于python-3.x - Content-Disposition header Azure HTTP 触发函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67269583/