Http 无法使用Vert.X 3.0.0中的getBodyAsJson()访问请求正文
我正在使用Vert.x3.0.0-milestone5开发一个示例web应用程序。就路由而言,一切正常,但我无法使用Http 无法使用Vert.X 3.0.0中的getBodyAsJson()访问请求正文,http,vert.x,Http,Vert.x,我正在使用Vert.x3.0.0-milestone5开发一个示例web应用程序。就路由而言,一切正常,但我无法使用 routingContext.getBodyAsJson()或 routingContext.getBody()或 routingContext.getBodyAsString()。 是完整的说明。如果要使用 routingContext.getBody(); routingContext.getBodyAsJson(); 首先需要添加一个如下所示的主体处理程序: router
routingContext.getBodyAsJson()
或
routingContext.getBody()
或
routingContext.getBodyAsString()
。
是完整的说明。如果要使用
routingContext.getBody();
routingContext.getBodyAsJson();
首先需要添加一个如下所示的主体处理程序:
router.route().handler(BodyHandler.create());
好的,明白了。我们需要使用router.route().handler(BodyHandler.create())创建BodyHandler。多亏了蒂姆·福克斯。