今天在小程序上传文件的时候在header携带了自定义的数据然后给我报错了Invalid character in header
我以为是我后端的数据处理错误调试了一下发现是开发工具根本没发送出去,小程序的header没有修复?
解决代码
var header={}
header['tok']=123
wx.uploadFile({
url: 'http://localhost:3000/upload',
filePath:res.tempFiles[0].path,
name: res.tempFiles[0].name,
header,
必须要这样添加数据才行直接在header会报错