SHARE
TWEET

Vertx Post Fail

abaw7 Jan 29th, 2016 5 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. HttpClientOptions options = new HttpClientOptions().setKeepAlive(true).setConnectTimeout(300).setIdleTimeout(300);
  2.         HttpClient client = vertx.createHttpClient(options);
  3.         JsonObject Params = new JsonObject();
  4.         Logger logger = Logger.getLogger("Login");
  5.         Params.put("username", "REMOVED FOR PRIVACY");
  6.         Params.put("password", "REMOVED FOR PRIVACY");
  7.         logger.info("Not valid Cookie");
  8.         HttpClientRequest Request = client.postAbs("https://www.roblox.com:443/NewLogin", Res -> {
  9.             logger.info("Sent Login Request");
  10.             logger.info(Params.encode());
  11.             Res.bodyHandler(Body -> {
  12.                 logger.info("We have the Body");
  13.                 logger.info(String.valueOf(Res.cookies().size()));
  14.                 logger.info(Body.toString());
  15.                 for (String TempCookie : Res.cookies()) {
  16.                     logger.info(TempCookie);
  17.                     if (TempCookie.startsWith(".ROBLOSECURITY=")) { //We have it!
  18.                         logger.info("We have the cookie");
  19.                     }
  20.                 }
  21.             });
  22.         });
  23.         logger.info("Headers start");
  24.         Request.putHeader("Accept", "*/*");
  25.         Request.putHeader("Accept-Encoding", "gzip, deflate");
  26.         Request.putHeader("Content-Type", "application/json");
  27.         Request.putHeader("Content-Length", String.valueOf(Params.encode().length()));
  28.         logger.info(String.valueOf(Params.encode().length()));
  29.         Request.putHeader("User-Agent", "runscope/0.1");
  30.         logger.info("Headers End");
  31.         logger.info(Params.encode());
  32.         Request.write(Params.encode());
  33.         Request.end();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top