我在Postman中通过“发送和下载”按钮使用HTTP GET请求文件URL来验证HTTP内容类型标头和文件扩展名。我们在http://www.sample-videos.com上提供了不同类型的示例文件,以下是一些结果:
- 内容类型image/jpeg的文件被下载为response.jpg
- 内容类型audio/mpeg的文件被下载为response.mpg
- 内容类型为application/vnd.ms-excel的文件被下载为response.xls
- 内容类型为application/vnd.ms-powerpoint的文件被下载为sample.ppt
- 内容类型为text/plain的文件被下载为response.txt
- 内容类型为application/pdf的文件被下载为sample.pdf
- 内容类型text/csv的文件被下载为response.txt
text/csv
文件下载时扩展名变成了.txt
而不是.csv
?如下图所示: