Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String token = "_token="+(String) data.get("_token");
- String username = "username="+(String) data.get("username");
- String password = "password="+(String) data.get("password");
- String together = token+", "+password+", "+username;
- String encodedData = URLEncoder.encode(together, "UTF-8" );
- con = (HttpURLConnection) u.openConnection();
- con.setRequestMethod("POST");
- con.setRequestProperty("User-Agent", "Mozilla/5.0");
- con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
- con.setRequestProperty("Content-Length", String.valueOf(encodedData.length()));
- OutputStream os = con.getOutputStream();
- os.write(encodedData.getBytes());
Add Comment
Please, Sign In to add comment