Advertisement
Guest User

Untitled

a guest
Jan 8th, 2017
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>Object moved</title>
  4. </head>
  5. <body>
  6. <h2>Object moved to <a href="/GradebookSummary.aspx">here</a>.
  7. </h2>
  8. </body>
  9. </html>
  10.  
  11. OkHttpClient client = new OkHttpClient().newBuilder()
  12. .followRedirects(false)
  13. .followSslRedirects(false)
  14. .build();
  15. MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
  16. RequestBody body = RequestBody.create(mediaType, "checkCookiesEnabled=true&checkMobileDevice=false&checkStandaloneMode=false&checkTabletDevice=false&portalAccountUsername=username&portalAccountPassword=password");
  17. Request request = new Request.Builder()
  18. .url("https://hac.chicousd.org/LoginParent.aspx?page=GradebookSummary.aspx")
  19. .post(body)
  20. .addHeader("content-type", "application/x-www-form-urlencoded")
  21. .addHeader("cache-control", "no-cache")
  22. .build();
  23.  
  24. Response response = client.newCall(request).execute();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement