首页 > 解决方案 > 使用 PUT 方法发送图像文件

问题描述

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

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

标签: filepostmanput

解决方案


在使用 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.

希望这可以帮助!

按照下面的屏幕简短:

在此处输入图像描述

在此处输入图像描述


推荐阅读