【发布时间】:2017-08-24 08:46:19
【问题描述】:
我有短信网关,我可以提供网址并发送短信,如下所示。
"https://url/destination={mobileNum}&q=mypw\n&message={msg}\n"
我在 resttemplate 中使用过它并尝试发送短信,但它没有用。
public String send(String mobileNumber, String message) {
String uri = "https://url/destination={mobileNum}&q=mypw\n&message={msg}\n";
RestTemplate restTemplate = new RestTemplate();
URI result = restTemplate.postForLocation(uri, mobileNumber, message);
return result.toString();
//return null;
}
代码的其他部分工作正常。它没有给出任何错误。但短信发送部分不起作用。我该如何解决这个问题?
【问题讨论】:
-
也显示响应部分..您从短信网关 web 服务收到的内容
标签: java spring rest resttemplate