http://sms.api.bz/fetion.php?username=您的移动飞信登录手机号&password=您的移动飞信登录密码&sendto=接收短信的飞信好友手机号&message=短信内容
通过上面这个URL提交就可以发短信了
例如:http://sms.api.bz/fetion.php?username=13800138000&password=123456&sendto=13912345678&message=短信内容
于是写了个无聊的代码(解决刚才的乱码问题):
import java.io.IOException;
import org.apache.commons.httpclient.*;
import org.apache.commons.httpclient.methods.*;
import org.apache.commons.httpclient.params.HttpMethodParams;
class fection
{
static public void main(String []args) throws IOException
{
int i = 0;
while(i<3)//做人要厚道
{
String PostURL=("http://sms.api.bz/fetion.php?username=&password=&sendto=&message=");
HttpClient client = new HttpClient();
PostMethod postMethod = new PostMethod(PostURL);
postMethod.getParams().setParameter(HttpMethodParams.HTTP_CONTENT_CHARSET,"GBK");//发送中文,避免乱码
postMethod.addParameter("username","135********");
postMethod.addParameter("password","mypassword");
postMethod.addParameter("sendto","136********");//立方
postMethod.addParameter("message","哈哈,可以发中文了,共3条,这是第"+Integer.toString(i+1)+"条");
client.setConnectionTimeout(10000);
client.executeMethod(postMethod);
i++;
}
System.out.println("OK!");
}
}
HttpClient竟然要用那么多包,把我搞得晕晕的。。。
while(i<3)这个循环开始忘写i++了,于是是一个死循环,用xx同学的手机测试,于是段性爆掉了他的手机,罪过罪过啊。。。。