[ https://issues.apache.org/jira/browse/CAMEL-11162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16493507#comment-16493507 ]
Claus Ibsen edited comment on CAMEL-11162 at 5/29/18 2:22 PM: -------------------------------------------------------------- We would possible need to add a new option to turn this validation on|off. And then add some logic that checks for this: * server side consumes vs content-type provided by client (error 415) * server side produces vs accept header from client (error 406) * required parameters is included (body, path, query) * ??? was (Author: davsclaus): We would possible need to add a new option to turn this validation on|off. And then add some logic that checks for this: * server side consumes vs content-type provided by client * server side produces vs accept header from client (wonder if there is some special HTTP error code for this) * required parameters is included (body, path, query) * ??? > camel-rest - Should we add content-type check for server side > ------------------------------------------------------------- > > Key: CAMEL-11162 > URL: https://issues.apache.org/jira/browse/CAMEL-11162 > Project: Camel > Issue Type: Improvement > Components: camel-core > Reporter: Claus Ibsen > Assignee: Claus Ibsen > Priority: Major > Fix For: 2.22.0 > > > For example setting up a rest-dsl which consumes application/json and then a > client calls it with text/plain or application/xml, should we then automatic > let rest consumer detect this and return a HTTP status 415 (unsuported media > type) > Not all the HTTP server components does this today, eg jetty etc. But when > using restlet which is more natual REST it would do so. > We could then add an option to turn this on|off. > The check is only if the media-type is within the list that may have been > specified on consumes in the rest-dsl. -- This message was sent by Atlassian JIRA (v7.6.3#76005)