日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

HttpClient和DefaultHttpClient

發(fā)布時間:2023/12/20 编程问答 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 HttpClient和DefaultHttpClient 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

HttpClient 是接口,DefaultHttpClient是實現(xiàn)這個接口的子類

public interface HttpClient {/*** Obtains the parameters for this client.* These parameters will become defaults for all requests being* executed with this client, and for the parameters of* dependent objects in this client.** @return the default parameters*/HttpParams getParams();/*** Obtains the connection manager used by this client.** @return the connection manager*/ClientConnectionManager getConnectionManager();/*** Executes a request using the default context.** @param request the request to execute** @return the response to the request. This is always a final response,* never an intermediate response with an 1xx status code.* Whether redirects or authentication challenges will be returned* or handled automatically depends on the implementation and* configuration of this client.* @throws IOException in case of a problem or the connection was aborted* @throws ClientProtocolException in case of an http protocol error*/HttpResponse execute(HttpUriRequest request)throws IOException, ClientProtocolException;/*** Executes a request using the given context.* The route to the target will be determined by the HTTP client.** @param request the request to execute* @param context the context to use for the execution, or* <code>null</code> to use the default context** @return the response to the request. This is always a final response,* never an intermediate response with an 1xx status code.* Whether redirects or authentication challenges will be returned* or handled automatically depends on the implementation and* configuration of this client.* @throws IOException in case of a problem or the connection was aborted* @throws ClientProtocolException in case of an http protocol error*/HttpResponse execute(HttpUriRequest request, HttpContext context)throws IOException, ClientProtocolException;/*** Executes a request to the target using the default context.** @param target the target host for the request.* Implementations may accept <code>null</code>* if they can still determine a route, for example* to a default target or by inspecting the request.* @param request the request to execute** @return the response to the request. This is always a final response,* never an intermediate response with an 1xx status code.* Whether redirects or authentication challenges will be returned* or handled automatically depends on the implementation and* configuration of this client.* @throws IOException in case of a problem or the connection was aborted* @throws ClientProtocolException in case of an http protocol error*/HttpResponse execute(HttpHost target, HttpRequest request)throws IOException, ClientProtocolException;/*** Executes a request to the target using the given context.** @param target the target host for the request.* Implementations may accept <code>null</code>* if they can still determine a route, for example* to a default target or by inspecting the request.* @param request the request to execute* @param context the context to use for the execution, or* <code>null</code> to use the default context** @return the response to the request. This is always a final response,* never an intermediate response with an 1xx status code.* Whether redirects or authentication challenges will be returned* or handled automatically depends on the implementation and* configuration of this client.* @throws IOException in case of a problem or the connection was aborted* @throws ClientProtocolException in case of an http protocol error*/HttpResponse execute(HttpHost target, HttpRequest request,HttpContext context)throws IOException, ClientProtocolException;/*** Executes a request using the default context and processes the* response using the given response handler.** @param request the request to execute* @param responseHandler the response handler** @return the response object as generated by the response handler.* @throws IOException in case of a problem or the connection was aborted* @throws ClientProtocolException in case of an http protocol error*/<T> T execute(HttpUriRequest request, ResponseHandler<? extends T> responseHandler)throws IOException, ClientProtocolException;/*** Executes a request using the given context and processes the* response using the given response handler.** @param request the request to execute* @param responseHandler the response handler** @return the response object as generated by the response handler.* @throws IOException in case of a problem or the connection was aborted* @throws ClientProtocolException in case of an http protocol error*/<T> T execute(HttpUriRequest request, ResponseHandler<? extends T> responseHandler,HttpContext context)throws IOException, ClientProtocolException;/*** Executes a request to the target using the default context and * processes the response using the given response handler.** @param target the target host for the request.* Implementations may accept <code>null</code>* if they can still determine a route, for example* to a default target or by inspecting the request.* @param request the request to execute* @param responseHandler the response handler** @return the response object as generated by the response handler.* @throws IOException in case of a problem or the connection was aborted* @throws ClientProtocolException in case of an http protocol error*/<T> T execute(HttpHost target, HttpRequest request,ResponseHandler<? extends T> responseHandler)throws IOException, ClientProtocolException;/*** Executes a request to the target using the given context and * processes the response using the given response handler.** @param target the target host for the request.* Implementations may accept <code>null</code>* if they can still determine a route, for example* to a default target or by inspecting the request.* @param request the request to execute* @param responseHandler the response handler* @param context the context to use for the execution, or* <code>null</code> to use the default context** @return the response object as generated by the response handler.* @throws IOException in case of a problem or the connection was aborted* @throws ClientProtocolException in case of an http protocol error*/<T> T execute(HttpHost target, HttpRequest request,ResponseHandler<? extends T> responseHandler, HttpContext context)throws IOException, ClientProtocolException;} // interface HttpClient

總結(jié)

以上是生活随笔為你收集整理的HttpClient和DefaultHttpClient的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。