如何在邮递员中修改Content-Type

How to modify Content-Type in postman

我正在尝试在 postman 中测试我的逻辑应用 API,但我遇到了 header postman 自动添加

的问题

Content-Type = multipart/form-data;

当我将鼠标悬停在 content-type 选项卡上时看到了这个 “使用请求 body 选项卡来控制值或删除 header”

谁能帮我设置 Content-Type = application/json

从下拉菜单转到 Body -> select raw -> Select JSON。它应该如下图所示,然后将其设置为 application/json

Postman 不允许您根据您的 drop-down 选择编辑它 auto-generates 的 header,Content-Type 就是其中之一。

但是 允许您取消选择 auto-generated header 并添加自定义 Content-Type header 与你想要的任何值。就实际请求而言,这是等价的。