Promise异步

白天 夜间 首页 下载 阅读记录
  我的书签   添加书签   移除书签

axios下载二进制文件

浏览 152 扫码 分享 2023-11-19 16:48:46
  • responseType

    responseType

    设置responseType为blob类型

    1. xios({
    2. method: 'get',
    3. url: '/api/user', // 请求地址
    4. params,
    5. responseType: 'blob', // 设置接收格式为blob格式
    6. });

    https://www.imqianduan.com/vue/axios-file-download-blob.html

    content-disposition

    1. content-disposition: attachment; filename="screenshot.png"

    若有收获,就点个赞吧

    0 人点赞

    上一篇:
    下一篇:
    • 书签
    • 添加书签 移除书签
    • 异常和异常链
      • Illegal invocation
    • JS 异步的发展
      • callback
      • XMLHttpRequest
        • responseType报错
        • createXHR
    • 深入Promise
      • Promise.try
      • Promise.abort
      • Promise.race
      • Promise.finally
      • async & await
      • generator & iterator迭代器
      • sleep
      • PromiseA 规范
      • Promise用法
    • fetch
      • fetch请求拦截器
      • fetch的封装
      • fetch跨域配置
      • fetch和 ajax的区别
    • axios
      • axios下载二进制文件
      • axios封装
        • axios headers
        • ErrorException
        • axiosRequest
      • assess_token无刷新登录
      • 并发请求的最佳实践
      • ajax请求时序控制
      • axios源码分析
    暂无相关搜索结果!

      让时间为你证明

      展开/收起文章目录

      分享,让知识传承更久远

      文章二维码

      手机扫一扫,轻松掌上读

      文档下载

      请下载您需要的格式的文档,随时随地,享受汲取知识的乐趣!
      PDF文档 EPUB文档 MOBI文档

      书签列表

        阅读记录

        阅读进度: 0.00% ( 0/0 ) 重置阅读进度

          思维导图备注