Guest User

Untitled

a guest
Jun 23rd, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. String token = "_token="+(String) data.get("_token");
  2. String username = "username="+(String) data.get("username");
  3. String password = "password="+(String) data.get("password");
  4. String together = token+", "+password+", "+username;
  5. String encodedData = URLEncoder.encode(together, "UTF-8" );
  6. con = (HttpURLConnection) u.openConnection();
  7. con.setRequestMethod("POST");
  8. con.setRequestProperty("User-Agent", "Mozilla/5.0");
  9. con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
  10. con.setRequestProperty("Content-Length", String.valueOf(encodedData.length()));
  11.  
  12.  
  13. OutputStream os = con.getOutputStream();
  14. os.write(encodedData.getBytes());
Add Comment
Please, Sign In to add comment