HttpEntity调用getContent步骤时的注意事项

HttpEntity调用getContent方法时的注意事项今天调试程序时,debug到下面这段代码时出的问题,具体是大括号里

HttpEntity调用getContent方法时的注意事项
今天调试程序时,debug到下面这段代码时出的问题,具体是大括号里面的那句:

java.lang.IllegalStateException: Content has been consumed

原因是在if的逻辑判断里已经调用过一次getContent方法,而此方法只能调用一次。