文檔(複製如下)並沒有提到IOException和HttpException在上下文中意味着什麼。如何在Apache HttpClient.execute(HttpMethod)中處理IOException和HttpException
我的問題是:在HttpClient.execute(HttpMethod)方法發生IOException後,是否必須放棄對象並創建新的HttpClient以便再次執行方法?還是它仍然可用(HttpClient對象)在發生這些異常之一後執行方法?
executeMethod public int executeMethod(HttpMethod method) throws IOException, HttpException Executes the given HTTP method. Parameters: method - the HTTP method to execute. Returns: the method's response code Throws: IOException - If an I/O (transport) error occurs. Some transport exceptions can be recovered from. HttpException - If a protocol exception occurs. Usually protocol exceptions cannot be recovered from.