qiniu / dart-sdk

Qiniu Resource (Cloud) Storage SDK for Dart
24 stars 25 forks source link

表单上传的key不是必填字段 #74

Closed zhangzqs closed 10 months ago

zhangzqs commented 10 months ago

根据官网API文档 https://developer.qiniu.com/kodo/1312/upload

表单上传里的key在服务端不是必填字段 https://github.com/qiniu/dart-sdk/blob/3c89d2800b1c1d0333e5eda271663be1b48bf304/base/lib/src/storage/methods/put/by_single/put_by_single_task.dart#L65-L68

但这里即使resource.name == null,dio也会默认填充空字符串 https://github.com/cfug/dio/blob/adc6842d6664d427bb06bc44aa870340bd127ef4/dio/lib/src/form_data.dart#L29

需要加上if (resource.name != null) 'key': resource.name

yinxulai commented 10 months ago

新版本 dio 问题