【发布时间】:2020-04-07 06:33:40
【问题描述】:
我正在使用带有 XML DSL 的 Apache Camel 来使用和公开 REST 服务。
我有一个请求正文{"name":"your name","phonenumber":"111-111"}
我成功地能够直接发送此 json 请求正文并从使用的端点 url 获得成功的响应。然而,当我浏览暴露的 URL 时,我得到了以下异常。
org.apache.camel.component.restlet.RestletOperationException: Restlet operation failed invoking
<!--Consumed URL--> with statusCode: 400 /n responseBody:
{"timestamp":"2020-04-07T06:15:41.302+0000","status":400,"error":"Bad Request",
"message":"Required request body is missing: public boolean
com.agcs.cids.BookingRestController.createBooking(org.bson.Document...)","path":"-----"}
我什至能够在调用 URL 之前成功打印正文。请在下面完善我的代码:
<log loggingLevel="TRACE" message="Request from source: Body: ${body}" />
<log loggingLevel="TRACE" message="Request from source: Header: ${headers}" />
<to uri="restlet:<--Consumed URL-->?restletMethod=POST" />
【问题讨论】:
标签: java rest apache-camel spring-camel