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

标签 python-3.x azure azure-functions xlsx azure-http-trigger

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

相关文章:

SQL Server 日期范围查询性能

azure - 使用 Postman 中的 HttpRequest 将图像上传到 Azure Functions

c# - 尝试将 Azure Function App 连接到 Azure Cosmos DB 表时出现错误 400

python - Keras 在使用 TensorFlow-gpu 时出现错误

python-3.x - 无法使用 fastai 的 pretrained_model=URLs.WT103

azure - 用于 asp.net core 的 ELMAH

azure - 如何撤销 aks get-credentials 中的 token ?

python - pandas - 按 index.name 与数据帧相交

python - 什么是 Python rq 包中的队列类、工作类、作业类

azure - 比较 AWS-lambda、Azure 函数和 Google Cloud Function