19

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.

Rahul Bhooteshwar
  • 1,675
  • 17
  • 31

2 Answers2

35

If you want to use

routingContext.getBody();
routingContext.getBodyAsJson();

You first need to add a body handler like below:

router.route().handler(BodyHandler.create());
hzitoun
  • 5,492
  • 1
  • 36
  • 43
aruis
  • 721
  • 7
  • 10
0

In new version of Vert.x these methods are Deprecated: link

So, you need to use body();. Or add this tag before @Deprecated

@Deprecated
routingContext.getBody();
routingContext.getBodyAsJson();

Reference: Here