Created
January 27, 2014 19:58
-
-
Save jasonroelofs/8656103 to your computer and use it in GitHub Desktop.
Simple Snitching in Java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Using raw java.net.* | |
URL obj = new URL("https://nosnch.in/[snitch code]?m=[message]"); | |
HttpURLConnection con = (HttpURLConnection) obj.openConnection(); | |
con.setRequestMethod("GET"); | |
con.getResponseCode(); | |
// Apache HttpComponents http://hc.apache.org/httpcomponents-client-ga/quickstart.html | |
CloseableHttpClient httpclient = HttpClients.createDefault(); | |
HttpGet httpGet = new HttpGet("https://nosnch.in/[snitch code]?m=[message]"); | |
CloseableHttpResponse response1 = httpclient.execute(httpGet); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment