/* this is Developed by using COMMONS-HTTPCLIENT Api of apache * set the classpath to all the jar files of commons-httpclient api and its Dependencies */ import org.apache.commons.httpclient.*; import org.apache.commons.httpclient.methods.*; import org.apache.commons.httpclient.params.HttpMethodParams; import java.io.IOException; import java.io.UnsupportedEncodingException; public class HttpUrlPush { public static void main(String[] args)throws IOException { HttpClient client=null; PostMethod post=null; String url; client = new HttpClient(new MultiThreadedHttpConnectionManager()); /* SETUP PROXY */ client.getHostConfiguration().setProxy("YOUR PROXY", PROXYPORT); client.getHttpConnectionManager().getParams().setConnectionTimeout(30000);//set ur time url = "http://www.smscountry.com/SMSCwebservice.asp"; post = new PostMethod(url); //give all in string post.addParameter("User", "USERNAME"); post.addParameter("passwd", "PASSWORD"); post.addParameter("mobilenumber", "9199XXXXXX,91XXXXX,...."); post.addParameter("message", "TYPE YOUR MESSAGE"); post.addParameter("sid","SENDER ID"); post.addParameter("mtype", "GIVE SMS TYPE"); post.addParameter("DR", "DELIVERYREPORTS YES or NOT"); /* PUSH the URL */ try { int statusCode = client.executeMethod(post); System.out.println(post.getStatusLine().toString()); if (statusCode != HttpStatus.SC_OK) { System.err.println("Method failed: " + post.getStatusLine()); } } catch (Exception e) { e.printStackTrace(); } finally { post.releaseConnection(); } } }