title: Vert.x - Get parameters from POST request
body: <p>Im trying to create a Vert.x Rest service that responds to POST requests on some URL\analysis.</p>
  
  <p>Using the following command </p>
  
  <blockquote>
    <p>curl -D- <a href="http://localhost:8080" rel="nofollow noreferrer">http://localhost:8080</a>\analyze -d '{"text":"bla"}'</p>
  </blockquote>
  
  <p>I want to extract "bla" from the command and perform simple text analysis on it.:</p>
  
  <p>Here is the draft of my code:</p>
  
  <pre><code>    @Override
  public void start(Future&lt;Void&gt; fut) throws Exception {
  
      router = Router.router(vertx);
      router.post("/analyze").handler(this::analyze);
  
      // Create Http server and pass the 'accept' method to the request handler
      vertx.createHttpServer().requestHandler(router::accept).
              listen(config().getInteger("http.port", 9000),
                      result -&gt; {
                          if (result.succeeded()) {
                              System.out.println("Http server completed..");
                              fut.complete();
                          } else {
                              fut.fail(result.cause());
                              System.out.println("Http server failed..");
                          }
                      }
              );
  }
  
  
  private void analyze(RoutingContext context) {
      HttpServerResponse response = context.response();
      String bodyAsString = context.getBodyAsString();
      JsonObject body = context.getBodyAsJson();
  
      if (body == null){
          response.end("The Json body is null. Please recheck.." + System.lineSeparator());
      }
      else
      {
          String postedText = body.getString("text");
          response.setStatusCode(200);
          response.putHeader("content-type", "text/html");
          response.end("you posted json which contains the following " + postedText);
      }
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Do you know how can I get the "bla" from POST? </p>