收藏
回答

wx.request请求会对返回的数据又大小限制吗

问题模块 框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
API和组件 小程序 Bug request 客户端 6.5.3 2.6.6


在微信小程序使用wx.request调用后端接口返回的图片base64格式数据和使用postman请求返回的数据不一样,微信小程序里的base64数据的长度比postman里返回的数据短。

各位大佬有谁知道原因吗?

postman里返回的数据:



小程序里返回的数据:


最后一次编辑于  04-24
回答关注问题邀请回答
收藏

3 个回答

  • 社区技术运营专员-小柿子
    社区技术运营专员-小柿子
    04-24

    提供下请求的url看下

    04-24
    赞同
    回复 4
    • 马克飞
      马克飞
      04-24

      https://app.ahmhcentre.com:8083/his-hfsy/api/resource/listResourceByType

      04-24
      回复
    • 马克飞
      马克飞
      04-24回复马克飞

      post请求 参数  resourceType:住院须知

      返回的是一段html img里的src属性


      04-24
      回复
    • 马克飞
      马克飞
      04-24

      微信小程序里接收到的数据:

      data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAAAAAAAD/2wBDAA0JCgsKERsXFRcOHRsfJyAVJyUSJyccHhcgLikxMC4pLSwzOko+MzZGN1ktQFdBRkxOUlNSMj5aYVpQYEpRUk//2wBDAQ4dHRMRJyYVFU1PNS01T09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0//wAARCAMyAkQDASIAAhEBAxEB/8QAGwABAAMBAQEBAAAAAAAAAAAAAAEEBQMCBgf/xABFEAACAQIDBAgFAAoCAQQCAQUAAQIDEQQSIRQxQVEFEyIyUmFxkQYVgaGxFiMzQlNUYsHR8DRyB0OC4fEkNbJEg5Kiwv/EABkBAQEBAQEBAAAAAAAAAAAAAAABAgQDBf/EACcRAQABBAICAwEBAAIDAAAAAAABAgMREhMhMVEiQWEycZHBI4Hw/9oADAMBAAIRAxEAPwD7ajRpZI9mG5cFyPfU0fDT9kKH7OPovwdDjYeOppeCn7IdTR8FP2R7JA59TS8NP2RPU0fBT9kewBz6mj4Kfsh1FHw0/ZHQAc+opeGn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AAEkACQAAACKAAKJAAAABQkgASCCQAIJRQAAAAAESQSAAAAkgAASCgQABIAAAAAACiviN69AMRvXoCqoUpyyLV7kes8+cgDwZM8+cic8+cgCBnnzkM8+cgChnnzkM8+cgAGefOQzz5yAAZ585E5585AFDPPnIZ585AAM8+chnnzl7gBTrJ85e4U585e4AE9ZPnL3HWT5y9wCh1k+cvcZ585AAM8+cvcnPPnIAB1k+cvcdZPnL3AAZ585DrJ85e4BQ6yfOXuOsnzl7gAOsnzl7jrJ85e4AE9ZPnL3HWT5y9wAHWT5y9x1k+cvcAB1k+cvcdZPnL3AKGefOQVSfOXuABPWT5y9x1k+cvcAB1k+cvcdZPnL3AAdZPnL3J6yfOXuAA6yfOXuQqk+cvcAqp6yfOXuOsnzl7gAOsnzl7jrJ85e4ADrJ85e46yfOXuAA6yfOXuOsnzl7gAOsnzl7k9ZPnL3AAdZPnL3J6yfOXuAUOsnzl7kdZPnL3AAnrJ85e46yfOXuABHWT5y9yesnzl7gAQqk+cvcnrJ85e4BQ6yfOXuOsnzl7gEDrJ85e46yfOXuAUca85XWr3AAo/9k= 

      04-24
      回复
    • 社区技术运营专员-小柿子
      社区技术运营专员-小柿子
      04-24回复马克飞

      看了没复现哦

      04-24
      回复
  • 曲路求真
    曲路求真
    07-25

    我也碰到了类似的问题,我请求的是一小段wav二进制音频,python request可以正常拿到数据,但是wx.request总是短一点,分析了包体,data数据被改动了。服务器并没做这种处理。烦的很

    07-25
    赞同
    回复
  • 马克飞
    马克飞
    04-24

    我刚才比较了一下,微信小程序返回的base64格式数据中间出现了省略号,不知道是不是因为base64格式的数据太长了,微信这边做了处理?

    04-24
    赞同
    回复 1
    • 微信技术专员 - Rex
      微信技术专员 - Rex
      05-22

      不是,是显示出来的时候加了省略逻辑,原始数据应该一样,建议用抓包工具看原始数据

      05-22
      回复