美文网首页
axios接受文件流转文件

axios接受文件流转文件

作者: Eaton_513f | 来源:发表于2018-09-19 09:25 被阅读0次

设置{responseType:'arraybuffer'}

axios.post(apiUrl, formdata, {responseType:'arraybuffer'}).then().catch();

axios 文档对responseType 的说明

`responseType` 表示服务器响应的数据类型,可以是 'arraybuffer', 'blob', 'document', 'json', 'text', 'stream'

默认的 responseType: 'json',  

相关文章

网友评论

      本文标题:axios接受文件流转文件

      本文链接:https://www.haomeiwen.com/subject/obybnftx.html