I am using Vert.x 3.0.0-milestone5, to develop a sample web application. Everything is working fine as far as the routing is concerned, but I am not able to access request parameters using
routingContext.getBodyAsJson()
or
routingContext.getBody()
or
routingContext.getBodyAsString()
.
Here is the complete description.
Unable to access request body using getBodyAsJson() in Vert.X 3.0.0
Ok got it. we need to create BodyHandler using router.route().handler(BodyHandler.create()). Thanks to Tim Fox linkedin.com/in/timfox. –
Physiologist
vertx.io/blog/some-rest-with-vert-x –
Spirula
If you want to use
routingContext.getBody();
routingContext.getBodyAsJson();
You first need to add a body handler like below:
router.route().handler(BodyHandler.create());
© 2022 - 2024 — McMap. All rights reserved.