Code example for HttpRequestBase

Methods: abort

0
 
		httpClient.getConnectionManager().closeExpiredConnections();
	} 
	 
	private void onExecuteException (HttpRequestBase httpRequest) {
		httpRequest.abort();
	} 
	 
	private byte[] getBytesResponse(HttpRequestBase httpRequest) throws NetWorkException {
		try { 
			preExecuteHttpRequest (); 
			ByteDataResponseHandler handler = new ByteDataResponseHandler();
			return httpClient.execute(httpRequest, handler);
		} catch (Exception e) {
			onExecuteException (httpRequest);
			throw new NetWorkException(NetWorkException.NETWORK_ERROR, "网络连接错误", e.toString());
		} 
	} 
	 
	private String getStringResponse(HttpRequestBase httpRequest) throws NetWorkException {
		try {