Skip to content

Instantly share code, notes, and snippets.

@webmonch
Created June 4, 2014 15:52
Show Gist options
  • Save webmonch/b0c24eb19a8c61aa333f to your computer and use it in GitHub Desktop.
Save webmonch/b0c24eb19a8c61aa333f to your computer and use it in GitHub Desktop.
private static void sendSms(String phone, String mes) {
URL obj;
try {
obj = new URL(urlFor(phone, mes));
HttpURLConnection con;
con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
BufferedReader in = new BufferedReader(new InputStreamReader(
con.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
in.close();
} catch (IOException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment