camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Owain McGuire (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CAMEL-11293) Rest DSL Producer HTTP ignores http verb from uri
Date Wed, 17 May 2017 16:21:04 GMT
Owain McGuire created CAMEL-11293:
-------------------------------------

             Summary: Rest DSL Producer HTTP ignores http verb from uri
                 Key: CAMEL-11293
                 URL: https://issues.apache.org/jira/browse/CAMEL-11293
             Project: Camel
          Issue Type: Bug
          Components: camel-http4
    Affects Versions: 2.19.0
            Reporter: Owain McGuire


As per http://camel.465427.n5.nabble.com/2-19-0-Rest-Producer-DSL-http4-support-for-PUT-workaround-td5799706.html

https://github.com/apache/camel/blob/camel-2.19.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/helper/HttpMethodHelper.java#L64

The createMethod function does not take the http verb from the URI, PUT is transformed to
a POST since there is a payload.  Resulting in an incorrect http request being formed.  The
verb from the URI should take precedence.  

There is a workaround of setting Exchange.HTTP_METHOD header as per:

      .setHeader(Exchange.HTTP_METHOD, constant(HttpMethods.PUT))
      .to("rest:put:api/resource/{{resource.id}}")

HttpHelperTest is lacking coverage of http verbs other than GET and POST




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message