Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
529 views
in Technique[技术] by (71.8m points)

使用postman模拟接口可以上传图片,本地怎么转换了

image.png
使用postman是可以上传成功的,
我本地也能从<input type="file"/> 里拿到图片文件信息了,需要怎么转换一下才是后端需要的文件资源格式么?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

这不 FormData 吗?你自己 new 一个往里写数据不就完了?

你要实在不会,Postman 还自带代码生成器,看图:

image.png


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...