小编emm*_*219的帖子

获取 org.apache.camel.component.http.HttpOperationFailedException 状态代码 405

我正在运行 servicemix 4.4.1。我正在尝试使用camel-http4 对网站进行http 调用。无论我尝试调用哪个网站,我都会收到此错误: org.apache.camel.RuntimeCamelException: org.apache.camel.component.http.HttpOperationFailedException: HTTP 操作失败调用http://servicemix.apache.org/downloads /servicemix-4.4.0.html状态代码:405

这是我的代码片段:

 <camelContext xmlns="http://camel.apache.org/schema/spring">
  <route>
    <from uri="activemq://events1"/>
<setHeader headerName="CamelHttpMethod">
    <constant>POST</constant>
</setHeader>
    <to uri="http://servicemix.apache.org/downloads/servicemix-4.4.0.html"/>
    <to uri="log:events"/>
  </route>
</camelContext>
Run Code Online (Sandbox Code Playgroud)

我尝试过许多网站并尝试使用不同的 http 方法(post 与 get),但我不断收到相同的错误。任何想法?提前致谢。

apache-camel http-status-code-405 apache-servicemix

7
推荐指数
1
解决办法
1万
查看次数