【发布时间】:2022-01-04 23:13:21
【问题描述】:
我如何使用 Axios 获取不是 json 数据的数据。例如来自网站the data i want to fetch的数据
【问题讨论】:
-
请提供数据示例,我无法理解您所附的图像。你说的只是来自网站的数据是什么意思,解释清楚
标签: javascript axios fetch
我如何使用 Axios 获取不是 json 数据的数据。例如来自网站the data i want to fetch的数据
【问题讨论】:
标签: javascript axios fetch
使用选项responseType
示例下载图片:https://stackoverflow.com/a/53230807/6250402
// `responseType` indicates the type of data that the server will respond with
// options are: 'arraybuffer', 'document', 'json', 'text', 'stream'
// browser only: 'blob'
responseType: 'json', // default
【讨论】: