Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Http 无法使用Vert.X 3.0.0中的getBodyAsJson()访问请求正文_Http_Vert.x - Fatal编程技术网

Http 无法使用Vert.X 3.0.0中的getBodyAsJson()访问请求正文

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

我正在使用Vert.x3.0.0-milestone5开发一个示例web应用程序。就路由而言,一切正常,但我无法使用
routingContext.getBodyAsJson()
routingContext.getBody()
routingContext.getBodyAsString()
。 是完整的说明。

如果要使用

routingContext.getBody();
routingContext.getBodyAsJson();
首先需要添加一个如下所示的主体处理程序:

router.route().handler(BodyHandler.create());

好的,明白了。我们需要使用router.route().handler(BodyHandler.create())创建BodyHandler。多亏了蒂姆·福克斯。