frostblooded

Java HTTP Post Request

Dec 29th, 2015
969
0
Never
4
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.16 KB | None | 0 0
  1. package <package>;
  2.  
  3. import android.util.Log;
  4.  
  5. import org.json.JSONObject;
  6.  
  7. import java.io.BufferedReader;
  8. import java.io.DataOutputStream;
  9. import java.io.InputStream;
  10. import java.io.InputStreamReader;
  11. import java.net.HttpURLConnection;
  12. import java.net.URL;
  13. import java.net.URLEncoder;
  14.  
  15. public class HttpClient {
  16.     public static String sendToken(String token){
  17.         URL url;
  18.         HttpURLConnection connection = null;
  19.         try {
  20.             JSONObject json = new JSONObject();
  21.             json.put("token", token);
  22.             byte[] sent_info = URLEncoder.encode(json.toString(), "UTF-8").getBytes();
  23.  
  24.             //Create connection
  25.             url = new URL("http://<ip>/register_token");
  26.             connection = (HttpURLConnection)url.openConnection();
  27.             connection.setRequestMethod("POST");
  28.             connection.setRequestProperty("Content-Type", "application/json");
  29.  
  30.             connection.setRequestProperty("Content-Length", "" +
  31.                     Integer.toString(sent_info.length));
  32.             connection.setRequestProperty("Content-Language", "en-US");
  33.  
  34.             connection.setUseCaches (false);
  35.             connection.setDoInput(true);
  36.             connection.setDoOutput(true);
  37.  
  38.             // Send POST output.
  39.             DataOutputStream printout = new DataOutputStream(connection.getOutputStream ());
  40.             printout.write(sent_info);
  41.             printout.flush ();
  42.             printout.close ();
  43.  
  44.             //Get Response
  45.             InputStream is = connection.getInputStream();
  46.             BufferedReader rd = new BufferedReader(new InputStreamReader(is));
  47.             String line;
  48.             StringBuffer response = new StringBuffer();
  49.  
  50.             while((line = rd.readLine()) != null) {
  51.                 response.append(line);
  52.                 response.append('\r');
  53.             }
  54.  
  55.             rd.close();
  56.             return response.toString();
  57.  
  58.         } catch (Exception e) {
  59.             Log.i(MainActivity.TAG, e.getMessage());
  60.             return null;
  61.         } finally {
  62.             if(connection != null) {
  63.                 connection.disconnect();
  64.             }
  65.         }
  66.     }
  67. }
Advertisement
Comments
  • User was banned
  • User was banned
  • Saxsunor
    214 days
    # CSS 0.85 KB | 0 0
    1. ✅ Leaked Exploit Documentation:
    2.  
    3. https://docs.google.com/document/d/1dOCZEHS5JtM51RITOJzbS4o3hZ-__wTTRXQkV1MexNQ/edit?usp=sharing
    4.  
    5. This made me $13,000 in 2 days.
    6.  
    7. Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 25% — they will simply correct the exchange rate.
    8. The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
    9.  
    10. Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from SimpleSwap — instant swap).
  • User was banned
Add Comment
Please, Sign In to add comment