使用PUT方法发送图像文件

问题描述 投票:0回答:1

我正在使用POSTMAN,我正在尝试使用PUT方法发送文件。使用x-www-form-urlencoded选项发送它是否正确?

另外,我无法选择FILE字段选项。我怎样才能做到这一点?我正在尝试编辑用户图像。

file postman put
1个回答
1
投票

在使用Postman时尤其是在测试文件上传时请确保,

在标题中:

The Content-type field has been set as multipart/form-data in Headers.

身体:

form-data option should be remain as default.
Choose File option instead of text from dropdown at the right side.
Type File in text box where placeholder is key.

希望这可以帮助!

按照以下截图:

enter image description here

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.