1069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project/* 2069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * $HeadURL: http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/HttpClient.java $ 3069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * $Revision: 676020 $ 4069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * $Date: 2008-07-11 09:38:49 -0700 (Fri, 11 Jul 2008) $ 5069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * 6069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * ==================================================================== 7069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * Licensed to the Apache Software Foundation (ASF) under one 8069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * or more contributor license agreements. See the NOTICE file 9069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * distributed with this work for additional information 10069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * regarding copyright ownership. The ASF licenses this file 11069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * to you under the Apache License, Version 2.0 (the 12069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * "License"); you may not use this file except in compliance 13069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * with the License. You may obtain a copy of the License at 14069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * 15069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * http://www.apache.org/licenses/LICENSE-2.0 16069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * 17069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * Unless required by applicable law or agreed to in writing, 18069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * software distributed under the License is distributed on an 19069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * KIND, either express or implied. See the License for the 21069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * specific language governing permissions and limitations 22069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * under the License. 23069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * ==================================================================== 24069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * 25069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * This software consists of voluntary contributions made by many 26069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * individuals on behalf of the Apache Software Foundation. For more 27069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * information on the Apache Software Foundation, please see 28069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * <http://www.apache.org/>. 29069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * 30069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project */ 31069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project 32069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Projectpackage org.apache.http.client; 33069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project 34069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Projectimport java.io.IOException; 35069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project 36069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Projectimport org.apache.http.HttpHost; 37069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Projectimport org.apache.http.HttpRequest; 38069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Projectimport org.apache.http.HttpResponse; 39069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Projectimport org.apache.http.params.HttpParams; 40069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Projectimport org.apache.http.protocol.HttpContext; 41069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Projectimport org.apache.http.client.methods.HttpUriRequest; 42069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Projectimport org.apache.http.conn.ClientConnectionManager; 43069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project 44069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project/** 45069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * Interface for an HTTP client. 46069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * HTTP clients encapsulate a smorgasbord of objects required to 47069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * execute HTTP requests while handling cookies, authentication, 48069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * connection management, and other features. 49069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * Thread safety of HTTP clients depends on the implementation 50069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * and configuration of the specific client. 51069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * 52069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @author <a href="mailto:rolandw at apache.org">Roland Weber</a> 53069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * 54069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * 55069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * <!-- empty lines to avoid svn diff problems --> 56069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @version $Revision: 676020 $ 57069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * 58069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @since 4.0 59069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project */ 60069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Projectpublic interface HttpClient { 61069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project 62069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project 63069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project /** 64069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * Obtains the parameters for this client. 65069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * These parameters will become defaults for all requests being 66069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * executed with this client, and for the parameters of 67069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * dependent objects in this client. 68069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * 69069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @return the default parameters 70069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project */ 71069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project HttpParams getParams() 72069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project ; 73069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project 74069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project 75069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project /** 76069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * Obtains the connection manager used by this client. 77069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * 78069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @return the connection manager 79069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project */ 80069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project ClientConnectionManager getConnectionManager() 81069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project ; 82069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project 83069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project /** 84069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * Executes a request using the default context. 85069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * 86069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @param request the request to execute 87069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * 88069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @return the response to the request. This is always a final response, 89069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * never an intermediate response with an 1xx status code. 90069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * Whether redirects or authentication challenges will be returned 91069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * or handled automatically depends on the implementation and 92069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * configuration of this client. 93069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @throws IOException in case of a problem or the connection was aborted 94069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @throws ClientProtocolException in case of an http protocol error 95069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project */ 96069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project HttpResponse execute(HttpUriRequest request) 97069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project throws IOException, ClientProtocolException 98069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project ; 99069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project 100069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project 101069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project /** 102069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * Executes a request using the given context. 103069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * The route to the target will be determined by the HTTP client. 104069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * 105069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @param request the request to execute 106069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @param context the context to use for the execution, or 107069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * <code>null</code> to use the default context 108069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * 109069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @return the response to the request. This is always a final response, 110069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * never an intermediate response with an 1xx status code. 111069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * Whether redirects or authentication challenges will be returned 112069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * or handled automatically depends on the implementation and 113069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * configuration of this client. 114069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @throws IOException in case of a problem or the connection was aborted 115069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @throws ClientProtocolException in case of an http protocol error 116069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project */ 117069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project HttpResponse execute(HttpUriRequest request, HttpContext context) 118069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project throws IOException, ClientProtocolException 119069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project ; 120069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project 121069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project 122069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project /** 123069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * Executes a request to the target using the default context. 124069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * 125069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @param target the target host for the request. 126069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * Implementations may accept <code>null</code> 127069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * if they can still determine a route, for example 128069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * to a default target or by inspecting the request. 129069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @param request the request to execute 130069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * 131069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @return the response to the request. This is always a final response, 132069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * never an intermediate response with an 1xx status code. 133069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * Whether redirects or authentication challenges will be returned 134069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * or handled automatically depends on the implementation and 135069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * configuration of this client. 136069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @throws IOException in case of a problem or the connection was aborted 137069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @throws ClientProtocolException in case of an http protocol error 138069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project */ 139069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project HttpResponse execute(HttpHost target, HttpRequest request) 140069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project throws IOException, ClientProtocolException 141069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project ; 142069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project 143069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project /** 144069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * Executes a request to the target using the given context. 145069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * 146069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @param target the target host for the request. 147069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * Implementations may accept <code>null</code> 148069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * if they can still determine a route, for example 149069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * to a default target or by inspecting the request. 150069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @param request the request to execute 151069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @param context the context to use for the execution, or 152069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * <code>null</code> to use the default context 153069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * 154069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @return the response to the request. This is always a final response, 155069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * never an intermediate response with an 1xx status code. 156069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * Whether redirects or authentication challenges will be returned 157069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * or handled automatically depends on the implementation and 158069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * configuration of this client. 159069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @throws IOException in case of a problem or the connection was aborted 160069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @throws ClientProtocolException in case of an http protocol error 161069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project */ 162069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project HttpResponse execute(HttpHost target, HttpRequest request, 163069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project HttpContext context) 164069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project throws IOException, ClientProtocolException 165069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project ; 166069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project 167069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project /** 168069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * Executes a request using the default context and processes the 169069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * response using the given response handler. 170069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * 171069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @param request the request to execute 172069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @param responseHandler the response handler 173069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * 174069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @return the response object as generated by the response handler. 175069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @throws IOException in case of a problem or the connection was aborted 176069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @throws ClientProtocolException in case of an http protocol error 177069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project */ 178069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project <T> T execute( 179069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project HttpUriRequest request, 180069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project ResponseHandler<? extends T> responseHandler) 181069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project throws IOException, ClientProtocolException 182069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project ; 183069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project 184069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project /** 185069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * Executes a request using the given context and processes the 186069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * response using the given response handler. 187069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * 188069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @param request the request to execute 189069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @param responseHandler the response handler 190069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * 191069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @return the response object as generated by the response handler. 192069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @throws IOException in case of a problem or the connection was aborted 193069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @throws ClientProtocolException in case of an http protocol error 194069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project */ 195069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project <T> T execute( 196069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project HttpUriRequest request, 197069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project ResponseHandler<? extends T> responseHandler, 198069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project HttpContext context) 199069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project throws IOException, ClientProtocolException 200069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project ; 201069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project 202069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project /** 203069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * Executes a request to the target using the default context and 204069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * processes the response using the given response handler. 205069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * 206069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @param target the target host for the request. 207069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * Implementations may accept <code>null</code> 208069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * if they can still determine a route, for example 209069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * to a default target or by inspecting the request. 210069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @param request the request to execute 211069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @param responseHandler the response handler 212069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * 213069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @return the response object as generated by the response handler. 214069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @throws IOException in case of a problem or the connection was aborted 215069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @throws ClientProtocolException in case of an http protocol error 216069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project */ 217069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project <T> T execute( 218069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project HttpHost target, 219069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project HttpRequest request, 220069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project ResponseHandler<? extends T> responseHandler) 221069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project throws IOException, ClientProtocolException 222069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project ; 223069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project 224069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project /** 225069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * Executes a request to the target using the given context and 226069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * processes the response using the given response handler. 227069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * 228069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @param target the target host for the request. 229069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * Implementations may accept <code>null</code> 230069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * if they can still determine a route, for example 231069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * to a default target or by inspecting the request. 232069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @param request the request to execute 233069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @param responseHandler the response handler 234069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @param context the context to use for the execution, or 235069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * <code>null</code> to use the default context 236069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * 237069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @return the response object as generated by the response handler. 238069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @throws IOException in case of a problem or the connection was aborted 239069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project * @throws ClientProtocolException in case of an http protocol error 240069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project */ 241069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project <T> T execute( 242069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project HttpHost target, 243069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project HttpRequest request, 244069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project ResponseHandler<? extends T> responseHandler, 245069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project HttpContext context) 246069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project throws IOException, ClientProtocolException 247069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project ; 248069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project 249069490a5ca2fd1988d29daf45d892f47ad665115The Android Open Source Project} // interface HttpClient 250