gpt4 book ai didi

python-3.x - Content-Disposition header Azure HTTP 触发函数

转载 作者:行者123 更新时间:2023-12-02 08:22:34 25 4
gpt4 key购买 nike

基本上,我正在尝试从 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com