以下是我的代码。它没有错误在控制台中说'确定'但没有收到消息。我的代码会发生什么?
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();
}