public class SendMessage {
public static void main(String[] args) throws UnsupportedEncodingException
{
//String strMsg=java.net.URLEncoder.encode("This is API msg", "UTF-8");
callURL("https://api.mVaayoo.com/mvaayooapi/MessageCompose?user=user@gmail.com:1111&senderID=TEST SMS&receipientno=9999999999&dcs=0&msgtxt=msg&state=1");
}
public static void callURL(String strURL){
System.out.println(" URL is :"+strURL);
try{
URL obj = new URL(strURL);
HttpURLConnection httpReq = (HttpURLConnection)obj.openConnection();
httpReq.setDoOutput(true);
httpReq.setInstanceFollowRedirects(true);
httpReq.setRequestMethod("GET");
String iStatus = httpReq.getResponseMessage();
System.out.println("iStatus: "+iStatus);
} catch (MalformedURLException ex) {
ex.printStackTrace();
}catch (IOException ex) {
ex.printStackTrace();
}catch(Exception e){
e.printStackTrace();
}
}
}
nHulk
-5
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.