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

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

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.20.1
    • Fix Version/s: 2.21.0
    • Component/s: camel-core, camel-servlet
    • Labels:
      None
    • Estimated Complexity:
      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

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              panjacek Jacek Obarymski

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment