1

I am writing client in Vertx for sending get request with two string parameters but i am receiving empty list from server. If i write request to another service which is on the same path but this service is not receiving any parameters the response is ok and the data is properly returned. The problem is with mapping the parameter on server side with .addQueryParam the parameter is not mapped well on server side. any help?

WebClient client = WebClient.create(vertx);
client
.get(80, "localhost", "/mainpath/path1")
.addQueryParam("startDate", "1459926000")
.addQueryParam("endDate", "1459926900")
.send(ar -> {
    if (ar.succeeded()) {
      HttpResponse<Buffer> response = ar.result();
      JsonArray body = response.bodyAsJsonArray();
      System.out.println("Received response with status code " + response.statusCode() + " with body " + body.toString());
    } else {
      System.out.println("Something went wrong " + ar.cause().getMessage());
    }
  });
}
taurus
  • 252
  • 2
  • 9
  • 2
    I found a solution. On server side the parameters weren't mapped well because they need to be send as a path variable. After making changes in the request and sending the request, data from server was properly returned. – taurus Dec 13 '17 at 10:51

0 Answers0