0

I access an API and it returns the result as success, but I want to convert result to type integer, when I try, it show me the error

cannot convert from completionStage to integer

My code

WSRequest req1 = ws.url("https://localhost/v1.0/mobile/user/profile")
            .addHeader("Authorization", token);
    CompletionStage<? extends WSResponse> rsp1 = req1.get();
    int a;

    return a = rsp1.thenApply(rs->ok(rs.asJson().findPath("user").findPath("id")));
user158
  • 12,852
  • 7
  • 62
  • 94

0 Answers0