【问题标题】:Send image file using PUT method使用 PUT 方法发送图像文件
【发布时间】:2019-08-30 04:02:34
【问题描述】:

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

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

【问题讨论】:

  • 嗨 Hermus,欢迎来到 Stack Overflow!当询问有关由您的代码引起的问题的问题时,如果您提供人们可以用来重现问题的代码,您将获得更好的答案。考虑包括您正在尝试的请求的示例。请参阅:How to create a Minimal, Complete, and Verifiable example。祝你好运!
  • @Hermus fyi 答案是this answer的副本

标签: file postman put


【解决方案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.

希望这会有所帮助!

按照下面的屏幕短:

【讨论】:

    猜你喜欢
    • 2016-09-04
    • 1970-01-01
    • 2014-07-17
    • 2023-02-21
    • 1970-01-01
    • 2019-05-05
    • 1970-01-01
    • 1970-01-01
    • 2021-01-17
    相关资源
    最近更新 更多