Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-12050

Camel Rest DSL returns 404 instead of 405, when http method is not supported

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.20.1
    • 2.21.0
    • camel-core, camel-servlet
    • None
    • Unknown

    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.

      restConfiguration()
      .component("servlet")
      .bindingMode(json)
      .dataFormatProperty("prettyPrint", "true");

      rest("my-resource-url-here")
      .get()
      .consumes("application/json")
      .produces("application/json")
      .type(MyRequestClass.class)
      .to("...")

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            panjacek Jacek Obarymski
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: