[ 
https://issues.apache.org/jira/browse/CAMEL-12050?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jacek Obarymski updated CAMEL-12050:
------------------------------------
    Description: 
Hi,

I have a REST resource  with a GET method, defined using Rest DSL (and 
_servlet_ component) and it works well, returning 200 response. But when I send 
a PUT request (which is not yet implemented) it returns 404 (not found) which 
can confusing at times. It should rather return 405 (method not allowed) 
instead.

{quote}     
         restConfiguration()
                 .component("servlet")
                 .bindingMode(json)
                 .dataFormatProperty("prettyPrint", "true");
 
          rest("my-resource-url-here")
                 .get()
                 .consumes("application/json")
                 .produces("application/json")
                 .type(MyRequestClass.class)
                 .to("...")
{quote}



  was:
Hi,

I have a REST resource  with a GET method, defined using Rest DSL (and 
_servlet_ component) and it works well, returning 200 response. But when I send 
a PUT request (which is not yet implemented) it returns 404 (not found) which 
can confusing at times. It should rather return 405 (method not allowed) 
instead.


     
bq.          restConfiguration()
bq.                 .component("servlet")
bq.                 .bindingMode(json)
bq.                 .dataFormatProperty("prettyPrint", "true");
bq. 
bq.          rest("my-resource-url-here")
bq.                 .get()
bq.                 .consumes("application/json")
bq.                 .produces("application/json")
bq.                 .type(MyRequestClass.class)
bq.                 .to("...")





> Camel Rest DSL returns 404 instead of 405, when http method is not supported
> ----------------------------------------------------------------------------
>
>                 Key: CAMEL-12050
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12050
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core, camel-servlet
>    Affects Versions: 2.20.1
>            Reporter: Jacek Obarymski
>
> Hi,
> I have a REST resource  with a GET method, defined using Rest DSL (and 
> _servlet_ component) and it works well, returning 200 response. But when I 
> send a PUT request (which is not yet implemented) it returns 404 (not found) 
> which can confusing at times. It should rather return 405 (method not 
> allowed) instead.
> {quote}     
>          restConfiguration()
>                  .component("servlet")
>                  .bindingMode(json)
>                  .dataFormatProperty("prettyPrint", "true");
>  
>           rest("my-resource-url-here")
>                  .get()
>                  .consumes("application/json")
>                  .produces("application/json")
>                  .type(MyRequestClass.class)
>                  .to("...")
> {quote}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to