我的用起来为啥总是不调用API,而是直接返回已经设好的句子“服务器繁忙,请稍后再试!”。是GET请求的原因吗?好像它不在支持GET请求了!
public static ChatMessage sendMessage(String msg)
{
ChatMessage chatMessage = new ChatMessage();
String jsonRes = doGet(msg);
Gson gson = new Gson();
Result result = null;
try
{
result = gson.fromJson(jsonRes, Result.class);
chatMessage.setMsg(result.getText());
} catch (Exception e)
{
chatMessage.setMsg("服务器繁忙,稍后再试...");
}
chatMessage.setDate(new Date());
chatMessage.setType(Type.INCOMING);
return chatMessage;
}