我正在尝试构建一个get请求,并且想知道如何验证传入的请求是否在请求中具有强制性标头。我的代码是
rest("/employee").id("get-Heartbeat").produces(JSON_MEDIA_TYPE)
.get().description("The heartbeat API").outType(Employee.class)
.responseMessage().code(HttpStatus.OK.toString()).message("Employee data").endResponseMessage()
.to("bean:EmployeeService?method=getEmployee()");
我想验证的强制性标题是header1,header2,header3。
您可以定义Rest DSL中的哪些部分是必需的,然后打开客户端请求验证,然后Camel将为您完成此操作。
在文档中查看更多:https://github.com/apache/camel/blob/master/docs/user-manual/modules/ROOT/pages/rest-dsl.adoc