5
|
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
2 <!--NewPage-->
|
|
3 <HTML>
|
|
4 <HEAD>
|
|
5 <!-- Generated by javadoc (build 1.5.0_11) on Sat Aug 23 11:49:48 GMT+01:00 2008 -->
|
|
6 <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
|
7 <TITLE>
|
|
8 HttpClient (HttpClient 4.0-beta1 API)
|
|
9 </TITLE>
|
|
10
|
|
11 <META NAME="keywords" CONTENT="org.apache.http.client.HttpClient interface">
|
|
12
|
|
13 <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
|
|
14
|
|
15 <SCRIPT type="text/javascript">
|
|
16 function windowTitle()
|
|
17 {
|
|
18 parent.document.title="HttpClient (HttpClient 4.0-beta1 API)";
|
|
19 }
|
|
20 </SCRIPT>
|
|
21 <NOSCRIPT>
|
|
22 </NOSCRIPT>
|
|
23
|
|
24 </HEAD>
|
|
25
|
|
26 <BODY BGCOLOR="white" onload="windowTitle();">
|
|
27
|
|
28
|
|
29 <!-- ========= START OF TOP NAVBAR ======= -->
|
|
30 <A NAME="navbar_top"><!-- --></A>
|
|
31 <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
|
|
32 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
|
33 <TR>
|
|
34 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
|
35 <A NAME="navbar_top_firstrow"><!-- --></A>
|
|
36 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
|
37 <TR ALIGN="center" VALIGN="top">
|
|
38 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
|
|
39 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
|
40 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
|
|
41 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/HttpClient.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
|
|
42 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
|
43 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
|
44 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
|
45 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
|
46 </TR>
|
|
47 </TABLE>
|
|
48 </TD>
|
|
49 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
|
50 </EM>
|
|
51 </TD>
|
|
52 </TR>
|
|
53
|
|
54 <TR>
|
|
55 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
|
56 <A HREF="../../../../org/apache/http/client/CredentialsProvider.html" title="interface in org.apache.http.client"><B>PREV CLASS</B></A>
|
|
57 <A HREF="../../../../org/apache/http/client/HttpRequestRetryHandler.html" title="interface in org.apache.http.client"><B>NEXT CLASS</B></A></FONT></TD>
|
|
58 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
|
59 <A HREF="../../../../index.html?org/apache/http/client/HttpClient.html" target="_top"><B>FRAMES</B></A>
|
|
60 <A HREF="HttpClient.html" target="_top"><B>NO FRAMES</B></A>
|
|
61 <SCRIPT type="text/javascript">
|
|
62 <!--
|
|
63 if(window==top) {
|
|
64 document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
|
|
65 }
|
|
66 //-->
|
|
67 </SCRIPT>
|
|
68 <NOSCRIPT>
|
|
69 <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
|
|
70 </NOSCRIPT>
|
|
71
|
|
72
|
|
73 </FONT></TD>
|
|
74 </TR>
|
|
75 <TR>
|
|
76 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
|
77 SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
|
78 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
|
79 DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
|
|
80 </TR>
|
|
81 </TABLE>
|
|
82 <A NAME="skip-navbar_top"></A>
|
|
83 <!-- ========= END OF TOP NAVBAR ========= -->
|
|
84
|
|
85 <HR>
|
|
86 <!-- ======== START OF CLASS DATA ======== -->
|
|
87 <H2>
|
|
88 <FONT SIZE="-1">
|
|
89 org.apache.http.client</FONT>
|
|
90 <BR>
|
|
91 Interface HttpClient</H2>
|
|
92 <DL>
|
|
93 <DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../org/apache/http/impl/client/AbstractHttpClient.html" title="class in org.apache.http.impl.client">AbstractHttpClient</A>, <A HREF="../../../../org/apache/http/impl/client/DefaultHttpClient.html" title="class in org.apache.http.impl.client">DefaultHttpClient</A></DD>
|
|
94 </DL>
|
|
95 <HR>
|
|
96 <DL>
|
|
97 <DT><PRE>public interface <B>HttpClient</B></DL>
|
|
98 </PRE>
|
|
99
|
|
100 <P>
|
|
101 Interface for an HTTP client.
|
|
102 HTTP clients act as a facade to a number of objects required to
|
|
103 execute HTTP requests while handling cookies, authentication,
|
|
104 connection management, and other features.
|
|
105 Thread safety of HTTP clients depends on the implementation
|
|
106 and configuration of the specific client.
|
|
107 <p/>
|
|
108 The usual execution flow can be demonstrated by the
|
|
109 code snippet below:
|
|
110 <PRE>
|
|
111 HttpClient httpclient = new DefaultHttpClient();
|
|
112
|
|
113 // Prepare a request object
|
|
114 HttpGet httpget = new HttpGet("http://www.apache.org/");
|
|
115
|
|
116 // Execute the request
|
|
117 HttpResponse response = httpclient.execute(httpget);
|
|
118
|
|
119 // Examine the response status
|
|
120 System.out.println(response.getStatusLine());
|
|
121
|
|
122 // Get hold of the response entity
|
|
123 HttpEntity entity = response.getEntity();
|
|
124
|
|
125 // If the response does not enclose an entity, there is no need
|
|
126 // to worry about connection release
|
|
127 if (entity != null) {
|
|
128 InputStream instream = entity.getContent();
|
|
129 try {
|
|
130
|
|
131 BufferedReader reader = new BufferedReader(
|
|
132 new InputStreamReader(instream));
|
|
133 // do something useful with the response
|
|
134 System.out.println(reader.readLine());
|
|
135
|
|
136 } catch (IOException ex) {
|
|
137
|
|
138 // In case of an IOException the connection will be released
|
|
139 // back to the connection manager automatically
|
|
140 throw ex;
|
|
141
|
|
142 } catch (RuntimeException ex) {
|
|
143
|
|
144 // In case of an unexpected exception you may want to abort
|
|
145 // the HTTP request in order to shut down the underlying
|
|
146 // connection and release it back to the connection manager.
|
|
147 httpget.abort();
|
|
148 throw ex;
|
|
149
|
|
150 } finally {
|
|
151
|
|
152 // Closing the input stream will trigger connection release
|
|
153 instream.close();
|
|
154
|
|
155 }
|
|
156 }
|
|
157 </PRE>
|
|
158 <P>
|
|
159
|
|
160 <P>
|
|
161 <DL>
|
|
162 <DT><B>Since:</B></DT>
|
|
163 <DD>4.0</DD>
|
|
164 <DT><B>Version:</B></DT>
|
|
165 <DD>$Revision: 679523 $</DD>
|
|
166 <DT><B>Author:</B></DT>
|
|
167 <DD><a href="mailto:rolandw at apache.org">Roland Weber</a>
|
|
168
|
|
169
|
|
170 <!-- empty lines to avoid svn diff problems --></DD>
|
|
171 </DL>
|
|
172 <HR>
|
|
173
|
|
174 <P>
|
|
175
|
|
176 <!-- ========== METHOD SUMMARY =========== -->
|
|
177
|
|
178 <A NAME="method_summary"><!-- --></A>
|
|
179 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
|
180 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
|
181 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
|
182 <B>Method Summary</B></FONT></TH>
|
|
183 </TR>
|
|
184 <TR BGCOLOR="white" CLASS="TableRowColor">
|
|
185 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
186 <CODE> org.apache.http.HttpResponse</CODE></FONT></TD>
|
|
187 <TD><CODE><B><A HREF="../../../../org/apache/http/client/HttpClient.html#execute(org.apache.http.HttpHost, org.apache.http.HttpRequest)">execute</A></B>(org.apache.http.HttpHost target,
|
|
188 org.apache.http.HttpRequest request)</CODE>
|
|
189
|
|
190 <BR>
|
|
191 Executes a request to the target using the default context.</TD>
|
|
192 </TR>
|
|
193 <TR BGCOLOR="white" CLASS="TableRowColor">
|
|
194 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
195 <CODE> org.apache.http.HttpResponse</CODE></FONT></TD>
|
|
196 <TD><CODE><B><A HREF="../../../../org/apache/http/client/HttpClient.html#execute(org.apache.http.HttpHost, org.apache.http.HttpRequest, org.apache.http.protocol.HttpContext)">execute</A></B>(org.apache.http.HttpHost target,
|
|
197 org.apache.http.HttpRequest request,
|
|
198 org.apache.http.protocol.HttpContext context)</CODE>
|
|
199
|
|
200 <BR>
|
|
201 Executes a request to the target using the given context.</TD>
|
|
202 </TR>
|
|
203 <TR BGCOLOR="white" CLASS="TableRowColor">
|
|
204 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
205 <CODE>
|
|
206 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
|
|
207 <TR ALIGN="right" VALIGN="">
|
|
208 <TD NOWRAP><FONT SIZE="-1">
|
|
209 <CODE><T> T</CODE></FONT></TD>
|
|
210 </TR>
|
|
211 </TABLE>
|
|
212 </CODE></FONT></TD>
|
|
213 <TD><CODE><B><A HREF="../../../../org/apache/http/client/HttpClient.html#execute(org.apache.http.HttpHost, org.apache.http.HttpRequest, org.apache.http.client.ResponseHandler)">execute</A></B>(org.apache.http.HttpHost target,
|
|
214 org.apache.http.HttpRequest request,
|
|
215 <A HREF="../../../../org/apache/http/client/ResponseHandler.html" title="interface in org.apache.http.client">ResponseHandler</A><? extends T> responseHandler)</CODE>
|
|
216
|
|
217 <BR>
|
|
218 Executes a request to the target using the default context and
|
|
219 processes the response using the given response handler.</TD>
|
|
220 </TR>
|
|
221 <TR BGCOLOR="white" CLASS="TableRowColor">
|
|
222 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
223 <CODE>
|
|
224 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
|
|
225 <TR ALIGN="right" VALIGN="">
|
|
226 <TD NOWRAP><FONT SIZE="-1">
|
|
227 <CODE><T> T</CODE></FONT></TD>
|
|
228 </TR>
|
|
229 </TABLE>
|
|
230 </CODE></FONT></TD>
|
|
231 <TD><CODE><B><A HREF="../../../../org/apache/http/client/HttpClient.html#execute(org.apache.http.HttpHost, org.apache.http.HttpRequest, org.apache.http.client.ResponseHandler, org.apache.http.protocol.HttpContext)">execute</A></B>(org.apache.http.HttpHost target,
|
|
232 org.apache.http.HttpRequest request,
|
|
233 <A HREF="../../../../org/apache/http/client/ResponseHandler.html" title="interface in org.apache.http.client">ResponseHandler</A><? extends T> responseHandler,
|
|
234 org.apache.http.protocol.HttpContext context)</CODE>
|
|
235
|
|
236 <BR>
|
|
237 Executes a request to the target using the given context and
|
|
238 processes the response using the given response handler.</TD>
|
|
239 </TR>
|
|
240 <TR BGCOLOR="white" CLASS="TableRowColor">
|
|
241 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
242 <CODE> org.apache.http.HttpResponse</CODE></FONT></TD>
|
|
243 <TD><CODE><B><A HREF="../../../../org/apache/http/client/HttpClient.html#execute(org.apache.http.client.methods.HttpUriRequest)">execute</A></B>(<A HREF="../../../../org/apache/http/client/methods/HttpUriRequest.html" title="interface in org.apache.http.client.methods">HttpUriRequest</A> request)</CODE>
|
|
244
|
|
245 <BR>
|
|
246 Executes a request using the default context.</TD>
|
|
247 </TR>
|
|
248 <TR BGCOLOR="white" CLASS="TableRowColor">
|
|
249 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
250 <CODE> org.apache.http.HttpResponse</CODE></FONT></TD>
|
|
251 <TD><CODE><B><A HREF="../../../../org/apache/http/client/HttpClient.html#execute(org.apache.http.client.methods.HttpUriRequest, org.apache.http.protocol.HttpContext)">execute</A></B>(<A HREF="../../../../org/apache/http/client/methods/HttpUriRequest.html" title="interface in org.apache.http.client.methods">HttpUriRequest</A> request,
|
|
252 org.apache.http.protocol.HttpContext context)</CODE>
|
|
253
|
|
254 <BR>
|
|
255 Executes a request using the given context.</TD>
|
|
256 </TR>
|
|
257 <TR BGCOLOR="white" CLASS="TableRowColor">
|
|
258 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
259 <CODE>
|
|
260 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
|
|
261 <TR ALIGN="right" VALIGN="">
|
|
262 <TD NOWRAP><FONT SIZE="-1">
|
|
263 <CODE><T> T</CODE></FONT></TD>
|
|
264 </TR>
|
|
265 </TABLE>
|
|
266 </CODE></FONT></TD>
|
|
267 <TD><CODE><B><A HREF="../../../../org/apache/http/client/HttpClient.html#execute(org.apache.http.client.methods.HttpUriRequest, org.apache.http.client.ResponseHandler)">execute</A></B>(<A HREF="../../../../org/apache/http/client/methods/HttpUriRequest.html" title="interface in org.apache.http.client.methods">HttpUriRequest</A> request,
|
|
268 <A HREF="../../../../org/apache/http/client/ResponseHandler.html" title="interface in org.apache.http.client">ResponseHandler</A><? extends T> responseHandler)</CODE>
|
|
269
|
|
270 <BR>
|
|
271 Executes a request using the default context and processes the
|
|
272 response using the given response handler.</TD>
|
|
273 </TR>
|
|
274 <TR BGCOLOR="white" CLASS="TableRowColor">
|
|
275 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
276 <CODE>
|
|
277 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
|
|
278 <TR ALIGN="right" VALIGN="">
|
|
279 <TD NOWRAP><FONT SIZE="-1">
|
|
280 <CODE><T> T</CODE></FONT></TD>
|
|
281 </TR>
|
|
282 </TABLE>
|
|
283 </CODE></FONT></TD>
|
|
284 <TD><CODE><B><A HREF="../../../../org/apache/http/client/HttpClient.html#execute(org.apache.http.client.methods.HttpUriRequest, org.apache.http.client.ResponseHandler, org.apache.http.protocol.HttpContext)">execute</A></B>(<A HREF="../../../../org/apache/http/client/methods/HttpUriRequest.html" title="interface in org.apache.http.client.methods">HttpUriRequest</A> request,
|
|
285 <A HREF="../../../../org/apache/http/client/ResponseHandler.html" title="interface in org.apache.http.client">ResponseHandler</A><? extends T> responseHandler,
|
|
286 org.apache.http.protocol.HttpContext context)</CODE>
|
|
287
|
|
288 <BR>
|
|
289 Executes a request using the given context and processes the
|
|
290 response using the given response handler.</TD>
|
|
291 </TR>
|
|
292 <TR BGCOLOR="white" CLASS="TableRowColor">
|
|
293 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
294 <CODE> <A HREF="../../../../org/apache/http/conn/ClientConnectionManager.html" title="interface in org.apache.http.conn">ClientConnectionManager</A></CODE></FONT></TD>
|
|
295 <TD><CODE><B><A HREF="../../../../org/apache/http/client/HttpClient.html#getConnectionManager()">getConnectionManager</A></B>()</CODE>
|
|
296
|
|
297 <BR>
|
|
298 Obtains the connection manager used by this client.</TD>
|
|
299 </TR>
|
|
300 <TR BGCOLOR="white" CLASS="TableRowColor">
|
|
301 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
302 <CODE> org.apache.http.params.HttpParams</CODE></FONT></TD>
|
|
303 <TD><CODE><B><A HREF="../../../../org/apache/http/client/HttpClient.html#getParams()">getParams</A></B>()</CODE>
|
|
304
|
|
305 <BR>
|
|
306 Obtains the parameters for this client.</TD>
|
|
307 </TR>
|
|
308 </TABLE>
|
|
309
|
|
310 <P>
|
|
311
|
|
312 <!-- ============ METHOD DETAIL ========== -->
|
|
313
|
|
314 <A NAME="method_detail"><!-- --></A>
|
|
315 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
|
316 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
|
317 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
|
|
318 <B>Method Detail</B></FONT></TH>
|
|
319 </TR>
|
|
320 </TABLE>
|
|
321
|
|
322 <A NAME="getParams()"><!-- --></A><H3>
|
|
323 getParams</H3>
|
|
324 <PRE>
|
|
325 org.apache.http.params.HttpParams <B>getParams</B>()</PRE>
|
|
326 <DL>
|
|
327 <DD>Obtains the parameters for this client.
|
|
328 These parameters will become defaults for all requests being
|
|
329 executed with this client, and for the parameters of
|
|
330 dependent objects in this client.
|
|
331 <P>
|
|
332 <DD><DL>
|
|
333
|
|
334 <DT><B>Returns:</B><DD>the default parameters</DL>
|
|
335 </DD>
|
|
336 </DL>
|
|
337 <HR>
|
|
338
|
|
339 <A NAME="getConnectionManager()"><!-- --></A><H3>
|
|
340 getConnectionManager</H3>
|
|
341 <PRE>
|
|
342 <A HREF="../../../../org/apache/http/conn/ClientConnectionManager.html" title="interface in org.apache.http.conn">ClientConnectionManager</A> <B>getConnectionManager</B>()</PRE>
|
|
343 <DL>
|
|
344 <DD>Obtains the connection manager used by this client.
|
|
345 <P>
|
|
346 <DD><DL>
|
|
347
|
|
348 <DT><B>Returns:</B><DD>the connection manager</DL>
|
|
349 </DD>
|
|
350 </DL>
|
|
351 <HR>
|
|
352
|
|
353 <A NAME="execute(org.apache.http.client.methods.HttpUriRequest)"><!-- --></A><H3>
|
|
354 execute</H3>
|
|
355 <PRE>
|
|
356 org.apache.http.HttpResponse <B>execute</B>(<A HREF="../../../../org/apache/http/client/methods/HttpUriRequest.html" title="interface in org.apache.http.client.methods">HttpUriRequest</A> request)
|
|
357 throws java.io.IOException,
|
|
358 <A HREF="../../../../org/apache/http/client/ClientProtocolException.html" title="class in org.apache.http.client">ClientProtocolException</A></PRE>
|
|
359 <DL>
|
|
360 <DD>Executes a request using the default context.
|
|
361 <P>
|
|
362 <DD><DL>
|
|
363 <DT><B>Parameters:</B><DD><CODE>request</CODE> - the request to execute
|
|
364 <DT><B>Returns:</B><DD>the response to the request. This is always a final response,
|
|
365 never an intermediate response with an 1xx status code.
|
|
366 Whether redirects or authentication challenges will be returned
|
|
367 or handled automatically depends on the implementation and
|
|
368 configuration of this client.
|
|
369 <DT><B>Throws:</B>
|
|
370 <DD><CODE>java.io.IOException</CODE> - in case of a problem or the connection was aborted
|
|
371 <DD><CODE><A HREF="../../../../org/apache/http/client/ClientProtocolException.html" title="class in org.apache.http.client">ClientProtocolException</A></CODE> - in case of an http protocol error</DL>
|
|
372 </DD>
|
|
373 </DL>
|
|
374 <HR>
|
|
375
|
|
376 <A NAME="execute(org.apache.http.client.methods.HttpUriRequest, org.apache.http.protocol.HttpContext)"><!-- --></A><H3>
|
|
377 execute</H3>
|
|
378 <PRE>
|
|
379 org.apache.http.HttpResponse <B>execute</B>(<A HREF="../../../../org/apache/http/client/methods/HttpUriRequest.html" title="interface in org.apache.http.client.methods">HttpUriRequest</A> request,
|
|
380 org.apache.http.protocol.HttpContext context)
|
|
381 throws java.io.IOException,
|
|
382 <A HREF="../../../../org/apache/http/client/ClientProtocolException.html" title="class in org.apache.http.client">ClientProtocolException</A></PRE>
|
|
383 <DL>
|
|
384 <DD>Executes a request using the given context.
|
|
385 The route to the target will be determined by the HTTP client.
|
|
386 <P>
|
|
387 <DD><DL>
|
|
388 <DT><B>Parameters:</B><DD><CODE>request</CODE> - the request to execute<DD><CODE>context</CODE> - the context to use for the execution, or
|
|
389 <code>null</code> to use the default context
|
|
390 <DT><B>Returns:</B><DD>the response to the request. This is always a final response,
|
|
391 never an intermediate response with an 1xx status code.
|
|
392 Whether redirects or authentication challenges will be returned
|
|
393 or handled automatically depends on the implementation and
|
|
394 configuration of this client.
|
|
395 <DT><B>Throws:</B>
|
|
396 <DD><CODE>java.io.IOException</CODE> - in case of a problem or the connection was aborted
|
|
397 <DD><CODE><A HREF="../../../../org/apache/http/client/ClientProtocolException.html" title="class in org.apache.http.client">ClientProtocolException</A></CODE> - in case of an http protocol error</DL>
|
|
398 </DD>
|
|
399 </DL>
|
|
400 <HR>
|
|
401
|
|
402 <A NAME="execute(org.apache.http.HttpHost, org.apache.http.HttpRequest)"><!-- --></A><H3>
|
|
403 execute</H3>
|
|
404 <PRE>
|
|
405 org.apache.http.HttpResponse <B>execute</B>(org.apache.http.HttpHost target,
|
|
406 org.apache.http.HttpRequest request)
|
|
407 throws java.io.IOException,
|
|
408 <A HREF="../../../../org/apache/http/client/ClientProtocolException.html" title="class in org.apache.http.client">ClientProtocolException</A></PRE>
|
|
409 <DL>
|
|
410 <DD>Executes a request to the target using the default context.
|
|
411 <P>
|
|
412 <DD><DL>
|
|
413 <DT><B>Parameters:</B><DD><CODE>target</CODE> - the target host for the request.
|
|
414 Implementations may accept <code>null</code>
|
|
415 if they can still determine a route, for example
|
|
416 to a default target or by inspecting the request.<DD><CODE>request</CODE> - the request to execute
|
|
417 <DT><B>Returns:</B><DD>the response to the request. This is always a final response,
|
|
418 never an intermediate response with an 1xx status code.
|
|
419 Whether redirects or authentication challenges will be returned
|
|
420 or handled automatically depends on the implementation and
|
|
421 configuration of this client.
|
|
422 <DT><B>Throws:</B>
|
|
423 <DD><CODE>java.io.IOException</CODE> - in case of a problem or the connection was aborted
|
|
424 <DD><CODE><A HREF="../../../../org/apache/http/client/ClientProtocolException.html" title="class in org.apache.http.client">ClientProtocolException</A></CODE> - in case of an http protocol error</DL>
|
|
425 </DD>
|
|
426 </DL>
|
|
427 <HR>
|
|
428
|
|
429 <A NAME="execute(org.apache.http.HttpHost, org.apache.http.HttpRequest, org.apache.http.protocol.HttpContext)"><!-- --></A><H3>
|
|
430 execute</H3>
|
|
431 <PRE>
|
|
432 org.apache.http.HttpResponse <B>execute</B>(org.apache.http.HttpHost target,
|
|
433 org.apache.http.HttpRequest request,
|
|
434 org.apache.http.protocol.HttpContext context)
|
|
435 throws java.io.IOException,
|
|
436 <A HREF="../../../../org/apache/http/client/ClientProtocolException.html" title="class in org.apache.http.client">ClientProtocolException</A></PRE>
|
|
437 <DL>
|
|
438 <DD>Executes a request to the target using the given context.
|
|
439 <P>
|
|
440 <DD><DL>
|
|
441 <DT><B>Parameters:</B><DD><CODE>target</CODE> - the target host for the request.
|
|
442 Implementations may accept <code>null</code>
|
|
443 if they can still determine a route, for example
|
|
444 to a default target or by inspecting the request.<DD><CODE>request</CODE> - the request to execute<DD><CODE>context</CODE> - the context to use for the execution, or
|
|
445 <code>null</code> to use the default context
|
|
446 <DT><B>Returns:</B><DD>the response to the request. This is always a final response,
|
|
447 never an intermediate response with an 1xx status code.
|
|
448 Whether redirects or authentication challenges will be returned
|
|
449 or handled automatically depends on the implementation and
|
|
450 configuration of this client.
|
|
451 <DT><B>Throws:</B>
|
|
452 <DD><CODE>java.io.IOException</CODE> - in case of a problem or the connection was aborted
|
|
453 <DD><CODE><A HREF="../../../../org/apache/http/client/ClientProtocolException.html" title="class in org.apache.http.client">ClientProtocolException</A></CODE> - in case of an http protocol error</DL>
|
|
454 </DD>
|
|
455 </DL>
|
|
456 <HR>
|
|
457
|
|
458 <A NAME="execute(org.apache.http.client.methods.HttpUriRequest, org.apache.http.client.ResponseHandler)"><!-- --></A><H3>
|
|
459 execute</H3>
|
|
460 <PRE>
|
|
461 <T> T <B>execute</B>(<A HREF="../../../../org/apache/http/client/methods/HttpUriRequest.html" title="interface in org.apache.http.client.methods">HttpUriRequest</A> request,
|
|
462 <A HREF="../../../../org/apache/http/client/ResponseHandler.html" title="interface in org.apache.http.client">ResponseHandler</A><? extends T> responseHandler)
|
|
463 throws java.io.IOException,
|
|
464 <A HREF="../../../../org/apache/http/client/ClientProtocolException.html" title="class in org.apache.http.client">ClientProtocolException</A></PRE>
|
|
465 <DL>
|
|
466 <DD>Executes a request using the default context and processes the
|
|
467 response using the given response handler.
|
|
468 <P>
|
|
469 <DD><DL>
|
|
470 <DT><B>Parameters:</B><DD><CODE>request</CODE> - the request to execute<DD><CODE>responseHandler</CODE> - the response handler
|
|
471 <DT><B>Returns:</B><DD>the response object as generated by the response handler.
|
|
472 <DT><B>Throws:</B>
|
|
473 <DD><CODE>java.io.IOException</CODE> - in case of a problem or the connection was aborted
|
|
474 <DD><CODE><A HREF="../../../../org/apache/http/client/ClientProtocolException.html" title="class in org.apache.http.client">ClientProtocolException</A></CODE> - in case of an http protocol error</DL>
|
|
475 </DD>
|
|
476 </DL>
|
|
477 <HR>
|
|
478
|
|
479 <A NAME="execute(org.apache.http.client.methods.HttpUriRequest, org.apache.http.client.ResponseHandler, org.apache.http.protocol.HttpContext)"><!-- --></A><H3>
|
|
480 execute</H3>
|
|
481 <PRE>
|
|
482 <T> T <B>execute</B>(<A HREF="../../../../org/apache/http/client/methods/HttpUriRequest.html" title="interface in org.apache.http.client.methods">HttpUriRequest</A> request,
|
|
483 <A HREF="../../../../org/apache/http/client/ResponseHandler.html" title="interface in org.apache.http.client">ResponseHandler</A><? extends T> responseHandler,
|
|
484 org.apache.http.protocol.HttpContext context)
|
|
485 throws java.io.IOException,
|
|
486 <A HREF="../../../../org/apache/http/client/ClientProtocolException.html" title="class in org.apache.http.client">ClientProtocolException</A></PRE>
|
|
487 <DL>
|
|
488 <DD>Executes a request using the given context and processes the
|
|
489 response using the given response handler.
|
|
490 <P>
|
|
491 <DD><DL>
|
|
492 <DT><B>Parameters:</B><DD><CODE>request</CODE> - the request to execute<DD><CODE>responseHandler</CODE> - the response handler
|
|
493 <DT><B>Returns:</B><DD>the response object as generated by the response handler.
|
|
494 <DT><B>Throws:</B>
|
|
495 <DD><CODE>java.io.IOException</CODE> - in case of a problem or the connection was aborted
|
|
496 <DD><CODE><A HREF="../../../../org/apache/http/client/ClientProtocolException.html" title="class in org.apache.http.client">ClientProtocolException</A></CODE> - in case of an http protocol error</DL>
|
|
497 </DD>
|
|
498 </DL>
|
|
499 <HR>
|
|
500
|
|
501 <A NAME="execute(org.apache.http.HttpHost, org.apache.http.HttpRequest, org.apache.http.client.ResponseHandler)"><!-- --></A><H3>
|
|
502 execute</H3>
|
|
503 <PRE>
|
|
504 <T> T <B>execute</B>(org.apache.http.HttpHost target,
|
|
505 org.apache.http.HttpRequest request,
|
|
506 <A HREF="../../../../org/apache/http/client/ResponseHandler.html" title="interface in org.apache.http.client">ResponseHandler</A><? extends T> responseHandler)
|
|
507 throws java.io.IOException,
|
|
508 <A HREF="../../../../org/apache/http/client/ClientProtocolException.html" title="class in org.apache.http.client">ClientProtocolException</A></PRE>
|
|
509 <DL>
|
|
510 <DD>Executes a request to the target using the default context and
|
|
511 processes the response using the given response handler.
|
|
512 <P>
|
|
513 <DD><DL>
|
|
514 <DT><B>Parameters:</B><DD><CODE>target</CODE> - the target host for the request.
|
|
515 Implementations may accept <code>null</code>
|
|
516 if they can still determine a route, for example
|
|
517 to a default target or by inspecting the request.<DD><CODE>request</CODE> - the request to execute<DD><CODE>responseHandler</CODE> - the response handler
|
|
518 <DT><B>Returns:</B><DD>the response object as generated by the response handler.
|
|
519 <DT><B>Throws:</B>
|
|
520 <DD><CODE>java.io.IOException</CODE> - in case of a problem or the connection was aborted
|
|
521 <DD><CODE><A HREF="../../../../org/apache/http/client/ClientProtocolException.html" title="class in org.apache.http.client">ClientProtocolException</A></CODE> - in case of an http protocol error</DL>
|
|
522 </DD>
|
|
523 </DL>
|
|
524 <HR>
|
|
525
|
|
526 <A NAME="execute(org.apache.http.HttpHost, org.apache.http.HttpRequest, org.apache.http.client.ResponseHandler, org.apache.http.protocol.HttpContext)"><!-- --></A><H3>
|
|
527 execute</H3>
|
|
528 <PRE>
|
|
529 <T> T <B>execute</B>(org.apache.http.HttpHost target,
|
|
530 org.apache.http.HttpRequest request,
|
|
531 <A HREF="../../../../org/apache/http/client/ResponseHandler.html" title="interface in org.apache.http.client">ResponseHandler</A><? extends T> responseHandler,
|
|
532 org.apache.http.protocol.HttpContext context)
|
|
533 throws java.io.IOException,
|
|
534 <A HREF="../../../../org/apache/http/client/ClientProtocolException.html" title="class in org.apache.http.client">ClientProtocolException</A></PRE>
|
|
535 <DL>
|
|
536 <DD>Executes a request to the target using the given context and
|
|
537 processes the response using the given response handler.
|
|
538 <P>
|
|
539 <DD><DL>
|
|
540 <DT><B>Parameters:</B><DD><CODE>target</CODE> - the target host for the request.
|
|
541 Implementations may accept <code>null</code>
|
|
542 if they can still determine a route, for example
|
|
543 to a default target or by inspecting the request.<DD><CODE>request</CODE> - the request to execute<DD><CODE>responseHandler</CODE> - the response handler<DD><CODE>context</CODE> - the context to use for the execution, or
|
|
544 <code>null</code> to use the default context
|
|
545 <DT><B>Returns:</B><DD>the response object as generated by the response handler.
|
|
546 <DT><B>Throws:</B>
|
|
547 <DD><CODE>java.io.IOException</CODE> - in case of a problem or the connection was aborted
|
|
548 <DD><CODE><A HREF="../../../../org/apache/http/client/ClientProtocolException.html" title="class in org.apache.http.client">ClientProtocolException</A></CODE> - in case of an http protocol error</DL>
|
|
549 </DD>
|
|
550 </DL>
|
|
551 <!-- ========= END OF CLASS DATA ========= -->
|
|
552 <HR>
|
|
553
|
|
554
|
|
555 <!-- ======= START OF BOTTOM NAVBAR ====== -->
|
|
556 <A NAME="navbar_bottom"><!-- --></A>
|
|
557 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
|
|
558 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
|
559 <TR>
|
|
560 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
|
561 <A NAME="navbar_bottom_firstrow"><!-- --></A>
|
|
562 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
|
563 <TR ALIGN="center" VALIGN="top">
|
|
564 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
|
|
565 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
|
566 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
|
|
567 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/HttpClient.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
|
|
568 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
|
569 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
|
570 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
|
571 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
|
572 </TR>
|
|
573 </TABLE>
|
|
574 </TD>
|
|
575 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
|
576 </EM>
|
|
577 </TD>
|
|
578 </TR>
|
|
579
|
|
580 <TR>
|
|
581 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
|
582 <A HREF="../../../../org/apache/http/client/CredentialsProvider.html" title="interface in org.apache.http.client"><B>PREV CLASS</B></A>
|
|
583 <A HREF="../../../../org/apache/http/client/HttpRequestRetryHandler.html" title="interface in org.apache.http.client"><B>NEXT CLASS</B></A></FONT></TD>
|
|
584 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
|
585 <A HREF="../../../../index.html?org/apache/http/client/HttpClient.html" target="_top"><B>FRAMES</B></A>
|
|
586 <A HREF="HttpClient.html" target="_top"><B>NO FRAMES</B></A>
|
|
587 <SCRIPT type="text/javascript">
|
|
588 <!--
|
|
589 if(window==top) {
|
|
590 document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
|
|
591 }
|
|
592 //-->
|
|
593 </SCRIPT>
|
|
594 <NOSCRIPT>
|
|
595 <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
|
|
596 </NOSCRIPT>
|
|
597
|
|
598
|
|
599 </FONT></TD>
|
|
600 </TR>
|
|
601 <TR>
|
|
602 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
|
603 SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
|
604 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
|
605 DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
|
|
606 </TR>
|
|
607 </TABLE>
|
|
608 <A NAME="skip-navbar_bottom"></A>
|
|
609 <!-- ======== END OF BOTTOM NAVBAR ======= -->
|
|
610
|
|
611 <HR>
|
|
612 Copyright © 1999-2008 <a href="http://www.apache.org/">Apache Software Foundation</a>. All Rights Reserved.
|
|
613 </BODY>
|
|
614 </HTML>
|