Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- http://localhost/index.php?option=com_jbackend&action=post&module=user&resource=login&username=<username>&password=<password>
- conn.setRequestProperty ("Authorization", session_id);
- conn = (HttpURLConnection) url.openConnection();
- conn.setRequestProperty("Authorization",session_id);
- conn.setDoOutput(true);
- wr = new DataOutputStream(conn.getOutputStream());
- wr.flush();
- wr.close();
- int responseCode = conn.getResponseCode();
- in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
- inputLine ="";
- response = new StringBuffer();
- while ((inputLine = in.readLine()) != null) {
- response.append(inputLine);
- }
- in.close();
- // print result
- System.out.println(response.toString());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement