Advertisement
Guest User

Untitled

a guest
Feb 8th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. http://localhost/index.php?option=com_jbackend&action=post&module=user&resource=login&username=<username>&password=<password>
  2.  
  3. conn.setRequestProperty ("Authorization", session_id);
  4.  
  5. conn = (HttpURLConnection) url.openConnection();
  6. conn.setRequestProperty("Authorization",session_id);
  7. conn.setDoOutput(true);
  8. wr = new DataOutputStream(conn.getOutputStream());
  9.  
  10. wr.flush();
  11. wr.close();
  12.  
  13. int responseCode = conn.getResponseCode();
  14.  
  15. in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
  16. inputLine ="";
  17. response = new StringBuffer();
  18.  
  19. while ((inputLine = in.readLine()) != null) {
  20. response.append(inputLine);
  21. }
  22. in.close();
  23.  
  24. // print result
  25. System.out.println(response.toString());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement