【问题标题】:Why Mule http inbound endpoint is always GET request为什么 Mule http 入站端点总是 GET 请求
【发布时间】:2014-09-21 12:17:28
【问题描述】:

为什么 Mule http 入站端点总是 GET 请求。我正在记录 http 方法的类型 它总是记录类型是 GET 即使我在 http 入站端指定了方法类型 PUT
观点。

 <http:inbound-endpoint exchange-pattern="request-response"
    path="testPath" doc:name="HTTP" 
    host="localhost" port="8083" 
    mimeType="application/json"
    method="PUT"/>

   <logger level="INFO" message="method type #[message.inboundProperties['http.method']]"
   doc:name="Logger"/>  <--- It always logs method is GET

   It never go into following expression block:

<choice doc:name="Choice">
   <when expression="#[message.inboundProperties['http.method']=='PUT']">

我想在 http 入站端点中将 http 方法设置为“PUT”

【问题讨论】:

  • 你的 HTTP 请求是怎样的?
  • 我正在通过浏览器发出我的 http 请求,使用 localhost:8083/testPath
  • 所以...您的端点总是会收到 HTTP GET,对吧?
  • 所以我在 Http 入站端点之后有一个 Mule-Logger。我在该记录器中记录 http 方法类型。是否有人需要调用我的 Http 入站端点来获取正确的方法类型?目前我只通过浏览器调用我的 Http 入站端点......

标签: mule inbound


【解决方案1】:

http:inbound-endpoint 上的 method 属性无效:您可以在其中放置任何值,它不会改变任何内容。

正如 Ale 所建议的,由 HTTP 客户端使用您希望在 Mule 端接收的任何方法。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2013-02-22
  • 2014-01-26
  • 1970-01-01
  • 2012-12-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-05-05
相关资源
最近更新 更多