You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Logic App HTTP POST请求报UnsupportedMediaType错误,Postman可正常运行

Logic App HTTP请求无Body时报"Content type '' not supported"错误

我在Logic App中调用HTTP请求时遇到以下错误:

{ "type": "https://errors-api.cloud.com/common/unsupportedMediaType", "detail": "Content type '' not supported", "parameters": null }

这个请求在Postman里不需要设置Body就能正常运行,但在Logic App里必须在Body区域填点内容(比如输入"body")才能正常工作,这让我很困惑,有没有人碰到过类似问题?


解决思路和方法

  • 对比Postman与Logic App的请求头:打开Postman请求控制台,查看请求成功时的Content-Type头值。Postman通常会自动补全合法的Content-Type(比如text/plain),但Logic App留空Body时,可能不会发送Content-Type头或发送空值,触发服务器校验报错。
  • 手动配置Content-Type与空Body:在Logic App的HTTP动作中,添加自定义头Content-Type,值设为Postman中显示的类型(比如text/plain或application/json),同时将Body设为空字符串"",而非直接留空。
  • 适配服务器校验规则:部分服务器即便允许空Body,也要求必须指定合法的Content-Type,不能是空值。Logic App默认在Body为空时不会自动添加该头,手动指定即可满足服务器要求。

内容的提问来源于stack exchange,提问作者hello007

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.09 03:15:40