我有错误:
error: unreported exception IOException; must be caught or declared to be thrown
代码:
ToRestApi rest = new ToRestApi();
HttpResponse response = rest.postToRestApiToken(objEnrolment,"enrolment");
HttpEntity entity = response.getEntity();
final String finalStats = EntityUtils.toString(entity);
我尝试在Try Catch
中使用它,但是它也不起作用
与错误有关的问题:EntityUtils.toString(entity);
答案 0 :(得分:0)
您遇到编译错误 您必须在方法签名的末尾添加一个引发异常的代码,或者将代码包装在try catch块中