Jakarta ee 使用OzekiNe HTTP请求使用Java向手机发送短信 我正在尝试使用Java通过OzekiNe HTTP请求向手机发送短信
下面是我的代码。在控制台中说“Ok”没有错误,但没有收到任何消息。我的代码怎么了Jakarta ee 使用OzekiNe HTTP请求使用Java向手机发送短信 我正在尝试使用Java通过OzekiNe HTTP请求向手机发送短信,jakarta-ee,Jakarta Ee,下面是我的代码。在控制台中说“Ok”没有错误,但没有收到任何消息。我的代码怎么了 public class Java_sms_httprequest { public static void main(String[] args) throws IOException { String recipient = "0979xxxxxxx"; // Phone Number Of Customer String message = "Hell
public class Java_sms_httprequest {
public static void main(String[] args) throws IOException {
String recipient = "0979xxxxxxx"; // Phone Number Of Customer
String message = "Hello"; // Message you want to send
String username = "admin"; // User Name of SMS GateWay
String password = "dynamic"; // Password of SMS GateWay
// They are need to connect SMS GateWay
String originator = "0920xxxxx";// Your Phone Number;
String requestURL = "http://127.0.0.1:9400/api?action=sendmessage&"
+ "username=" + URLEncoder.encode(username, "UTF-8")
+ "&password=" + URLEncoder.encode(password, "UTF-8")
+ "&recipient=" + URLEncoder.encode(recipient, "UTF-8")
+ "&messagetype=SMS:TEXT" + "&messagedata="
+ URLEncoder.encode(message, "UTF-8") + "&originator"
+ URLEncoder.encode(message, "UTF-8")
+ "&serviceprovider=HTTPServer0" + "&responseformat=html";
URL url = new URL(requestURL);
HttpURLConnection uc = (HttpURLConnection) url.openConnection();
System.out.println(uc.getResponseMessage());
uc.disconnect();
}