IHttpClient.Execute 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| Execute(IHttpUriRequest) |
根據給定上下文,向目標執行請求。 |
| Execute(IHttpUriRequest, IResponseHandler) |
使用預設上下文執行請求,並使用給定的回應處理器處理回應。 |
| Execute(IHttpUriRequest, IHttpContext) |
使用給定上下文執行請求。 |
| Execute(HttpHost, IHttpRequest) |
使用預設上下文執行對目標的請求。 |
| Execute(IHttpUriRequest, IResponseHandler, IHttpContext) |
使用給定上下文執行請求,並使用指定的回應處理器處理回應。 |
| Execute(HttpHost, IHttpRequest, IResponseHandler) |
使用預設上下文執行對目標的請求,並使用給定的回應處理器處理回應。 |
| Execute(HttpHost, IHttpRequest, IHttpContext) |
根據給定上下文,向目標執行請求。 |
| Execute(HttpHost, IHttpRequest, IResponseHandler, IHttpContext) |
根據給定上下文執行對目標的請求,並使用指定的回應處理器處理回應。 |
Execute(IHttpUriRequest)
根據給定上下文,向目標執行請求。
[Android.Runtime.Register("execute", "(Lorg/apache/http/client/methods/HttpUriRequest;)Lorg/apache/http/HttpResponse;", "GetExecute_Lorg_apache_http_client_methods_HttpUriRequest_Handler:Org.Apache.Http.Client.IHttpClientInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public Org.Apache.Http.IHttpResponse? Execute(Org.Apache.Http.Client.Methods.IHttpUriRequest? request);
[<Android.Runtime.Register("execute", "(Lorg/apache/http/client/methods/HttpUriRequest;)Lorg/apache/http/HttpResponse;", "GetExecute_Lorg_apache_http_client_methods_HttpUriRequest_Handler:Org.Apache.Http.Client.IHttpClientInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member Execute : Org.Apache.Http.Client.Methods.IHttpUriRequest -> Org.Apache.Http.IHttpResponse
參數
- request
- IHttpUriRequest
執行請求
傳回
這是對請求的最終回應。 它從來不是帶有 1xx 狀態碼的中間回應。 重定向或認證挑戰是否會被回傳或自動處理,取決於客戶端的實作與設定。
- 屬性
例外狀況
以防出現問題或連線中斷
在 HTTP 協定錯誤時
備註
此頁面的部分是根據 Android 開放原始碼專案所建立和共用的工作進行修改,並根據 Creative Commons 2.5 屬性授權中所述的詞彙使用。
適用於
Execute(IHttpUriRequest, IResponseHandler)
使用預設上下文執行請求,並使用給定的回應處理器處理回應。
[Android.Runtime.Register("execute", "(Lorg/apache/http/client/methods/HttpUriRequest;Lorg/apache/http/client/ResponseHandler;)Ljava/lang/Object;", "GetExecute_Lorg_apache_http_client_methods_HttpUriRequest_Lorg_apache_http_client_ResponseHandler_Handler:Org.Apache.Http.Client.IHttpClientInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public Java.Lang.Object? Execute(Org.Apache.Http.Client.Methods.IHttpUriRequest? request, Org.Apache.Http.Client.IResponseHandler? responseHandler);
[<Android.Runtime.Register("execute", "(Lorg/apache/http/client/methods/HttpUriRequest;Lorg/apache/http/client/ResponseHandler;)Ljava/lang/Object;", "GetExecute_Lorg_apache_http_client_methods_HttpUriRequest_Lorg_apache_http_client_ResponseHandler_Handler:Org.Apache.Http.Client.IHttpClientInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
abstract member Execute : Org.Apache.Http.Client.Methods.IHttpUriRequest * Org.Apache.Http.Client.IResponseHandler -> Java.Lang.Object
參數
- request
- IHttpUriRequest
執行請求。
- responseHandler
- IResponseHandler
回應處理器。
傳回
由回應處理器產生的回應物件。
- 屬性
備註
此頁面的部分是根據 Android 開放原始碼專案所建立和共用的工作進行修改,並根據 Creative Commons 2.5 屬性授權中所述的詞彙使用。
適用於
Execute(IHttpUriRequest, IHttpContext)
使用給定上下文執行請求。
[Android.Runtime.Register("execute", "(Lorg/apache/http/client/methods/HttpUriRequest;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/HttpResponse;", "GetExecute_Lorg_apache_http_client_methods_HttpUriRequest_Lorg_apache_http_protocol_HttpContext_Handler:Org.Apache.Http.Client.IHttpClientInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public Org.Apache.Http.IHttpResponse? Execute(Org.Apache.Http.Client.Methods.IHttpUriRequest? request, Org.Apache.Http.Protocol.IHttpContext? context);
[<Android.Runtime.Register("execute", "(Lorg/apache/http/client/methods/HttpUriRequest;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/HttpResponse;", "GetExecute_Lorg_apache_http_client_methods_HttpUriRequest_Lorg_apache_http_protocol_HttpContext_Handler:Org.Apache.Http.Client.IHttpClientInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member Execute : Org.Apache.Http.Client.Methods.IHttpUriRequest * Org.Apache.Http.Protocol.IHttpContext -> Org.Apache.Http.IHttpResponse
參數
- request
- IHttpUriRequest
執行請求
- context
- IHttpContext
執行時使用上下文,或 null 使用預設上下文
傳回
這是對請求的最終回應。 它從來不是帶有 1xx 狀態碼的中間回應。 重定向或認證挑戰是否會被回傳或自動處理,取決於客戶端的實作與設定。
- 屬性
例外狀況
以防出現問題或連線中斷
在 HTTP 協定錯誤時
備註
此頁面的部分是根據 Android 開放原始碼專案所建立和共用的工作進行修改,並根據 Creative Commons 2.5 屬性授權中所述的詞彙使用。
適用於
Execute(HttpHost, IHttpRequest)
使用預設上下文執行對目標的請求。
[Android.Runtime.Register("execute", "(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;)Lorg/apache/http/HttpResponse;", "GetExecute_Lorg_apache_http_HttpHost_Lorg_apache_http_HttpRequest_Handler:Org.Apache.Http.Client.IHttpClientInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public Org.Apache.Http.IHttpResponse? Execute(Org.Apache.Http.HttpHost? target, Org.Apache.Http.IHttpRequest? request);
[<Android.Runtime.Register("execute", "(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;)Lorg/apache/http/HttpResponse;", "GetExecute_Lorg_apache_http_HttpHost_Lorg_apache_http_HttpRequest_Handler:Org.Apache.Http.Client.IHttpClientInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member Execute : Org.Apache.Http.HttpHost * Org.Apache.Http.IHttpRequest -> Org.Apache.Http.IHttpResponse
參數
- target
- HttpHost
請求的目標主機。
如果實作仍能確定路由,例如指向預設目標或透過檢查請求,則可接受 null 。
- request
- IHttpRequest
執行請求
傳回
這是對請求的最終回應。 它從來不是帶有 1xx 狀態碼的中間回應。 重定向或認證挑戰是否會被回傳或自動處理,取決於客戶端的實作與設定。
- 屬性
例外狀況
以防出現問題或連線中斷
在 HTTP 協定錯誤時
備註
此頁面的部分是根據 Android 開放原始碼專案所建立和共用的工作進行修改,並根據 Creative Commons 2.5 屬性授權中所述的詞彙使用。
適用於
Execute(IHttpUriRequest, IResponseHandler, IHttpContext)
使用給定上下文執行請求,並使用指定的回應處理器處理回應。
[Android.Runtime.Register("execute", "(Lorg/apache/http/client/methods/HttpUriRequest;Lorg/apache/http/client/ResponseHandler;Lorg/apache/http/protocol/HttpContext;)Ljava/lang/Object;", "GetExecute_Lorg_apache_http_client_methods_HttpUriRequest_Lorg_apache_http_client_ResponseHandler_Lorg_apache_http_protocol_HttpContext_Handler:Org.Apache.Http.Client.IHttpClientInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public Java.Lang.Object? Execute(Org.Apache.Http.Client.Methods.IHttpUriRequest? request, Org.Apache.Http.Client.IResponseHandler? responseHandler, Org.Apache.Http.Protocol.IHttpContext? context);
[<Android.Runtime.Register("execute", "(Lorg/apache/http/client/methods/HttpUriRequest;Lorg/apache/http/client/ResponseHandler;Lorg/apache/http/protocol/HttpContext;)Ljava/lang/Object;", "GetExecute_Lorg_apache_http_client_methods_HttpUriRequest_Lorg_apache_http_client_ResponseHandler_Lorg_apache_http_protocol_HttpContext_Handler:Org.Apache.Http.Client.IHttpClientInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
abstract member Execute : Org.Apache.Http.Client.Methods.IHttpUriRequest * Org.Apache.Http.Client.IResponseHandler * Org.Apache.Http.Protocol.IHttpContext -> Java.Lang.Object
參數
- request
- IHttpUriRequest
執行請求。
- responseHandler
- IResponseHandler
回應處理器。
- context
- IHttpContext
執行時要用的上下文,或 null 是使用預設上下文。
傳回
由回應處理器產生的回應物件。
- 屬性
備註
此頁面的部分是根據 Android 開放原始碼專案所建立和共用的工作進行修改,並根據 Creative Commons 2.5 屬性授權中所述的詞彙使用。
適用於
Execute(HttpHost, IHttpRequest, IResponseHandler)
使用預設上下文執行對目標的請求,並使用給定的回應處理器處理回應。
[Android.Runtime.Register("execute", "(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;Lorg/apache/http/client/ResponseHandler;)Ljava/lang/Object;", "GetExecute_Lorg_apache_http_HttpHost_Lorg_apache_http_HttpRequest_Lorg_apache_http_client_ResponseHandler_Handler:Org.Apache.Http.Client.IHttpClientInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public Java.Lang.Object? Execute(Org.Apache.Http.HttpHost? target, Org.Apache.Http.IHttpRequest? request, Org.Apache.Http.Client.IResponseHandler? responseHandler);
[<Android.Runtime.Register("execute", "(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;Lorg/apache/http/client/ResponseHandler;)Ljava/lang/Object;", "GetExecute_Lorg_apache_http_HttpHost_Lorg_apache_http_HttpRequest_Lorg_apache_http_client_ResponseHandler_Handler:Org.Apache.Http.Client.IHttpClientInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
abstract member Execute : Org.Apache.Http.HttpHost * Org.Apache.Http.IHttpRequest * Org.Apache.Http.Client.IResponseHandler -> Java.Lang.Object
參數
- target
- HttpHost
請求的目標主機。 當實作仍能確定路由時,例如透過對預設目標或檢查請求,則可接受 null 。
- request
- IHttpRequest
執行請求。
- responseHandler
- IResponseHandler
回應處理器。
傳回
由回應處理器產生的回應物件。
- 屬性
備註
此頁面的部分是根據 Android 開放原始碼專案所建立和共用的工作進行修改,並根據 Creative Commons 2.5 屬性授權中所述的詞彙使用。
適用於
Execute(HttpHost, IHttpRequest, IHttpContext)
根據給定上下文,向目標執行請求。
[Android.Runtime.Register("execute", "(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/HttpResponse;", "GetExecute_Lorg_apache_http_HttpHost_Lorg_apache_http_HttpRequest_Lorg_apache_http_protocol_HttpContext_Handler:Org.Apache.Http.Client.IHttpClientInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public Org.Apache.Http.IHttpResponse? Execute(Org.Apache.Http.HttpHost? target, Org.Apache.Http.IHttpRequest? request, Org.Apache.Http.Protocol.IHttpContext? context);
[<Android.Runtime.Register("execute", "(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/HttpResponse;", "GetExecute_Lorg_apache_http_HttpHost_Lorg_apache_http_HttpRequest_Lorg_apache_http_protocol_HttpContext_Handler:Org.Apache.Http.Client.IHttpClientInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member Execute : Org.Apache.Http.HttpHost * Org.Apache.Http.IHttpRequest * Org.Apache.Http.Protocol.IHttpContext -> Org.Apache.Http.IHttpResponse
參數
- target
- HttpHost
請求的目標主機。
如果實作仍能確定路由,例如指向預設目標或透過檢查請求,則可接受 null 。
- request
- IHttpRequest
執行請求
- context
- IHttpContext
執行時使用上下文,或 null 使用預設上下文
傳回
這是對請求的最終回應。 它從來不是帶有 1xx 狀態碼的中間回應。 重定向或認證挑戰是否會被回傳或自動處理,取決於客戶端的實作與設定。
- 屬性
例外狀況
以防出現問題或連線中斷
在 HTTP 協定錯誤時
備註
此頁面的部分是根據 Android 開放原始碼專案所建立和共用的工作進行修改,並根據 Creative Commons 2.5 屬性授權中所述的詞彙使用。
適用於
Execute(HttpHost, IHttpRequest, IResponseHandler, IHttpContext)
根據給定上下文執行對目標的請求,並使用指定的回應處理器處理回應。
[Android.Runtime.Register("execute", "(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;Lorg/apache/http/client/ResponseHandler;Lorg/apache/http/protocol/HttpContext;)Ljava/lang/Object;", "GetExecute_Lorg_apache_http_HttpHost_Lorg_apache_http_HttpRequest_Lorg_apache_http_client_ResponseHandler_Lorg_apache_http_protocol_HttpContext_Handler:Org.Apache.Http.Client.IHttpClientInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public Java.Lang.Object? Execute(Org.Apache.Http.HttpHost? target, Org.Apache.Http.IHttpRequest? request, Org.Apache.Http.Client.IResponseHandler? responseHandler, Org.Apache.Http.Protocol.IHttpContext? context);
[<Android.Runtime.Register("execute", "(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;Lorg/apache/http/client/ResponseHandler;Lorg/apache/http/protocol/HttpContext;)Ljava/lang/Object;", "GetExecute_Lorg_apache_http_HttpHost_Lorg_apache_http_HttpRequest_Lorg_apache_http_client_ResponseHandler_Lorg_apache_http_protocol_HttpContext_Handler:Org.Apache.Http.Client.IHttpClientInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
abstract member Execute : Org.Apache.Http.HttpHost * Org.Apache.Http.IHttpRequest * Org.Apache.Http.Client.IResponseHandler * Org.Apache.Http.Protocol.IHttpContext -> Java.Lang.Object
參數
- target
- HttpHost
請求的目標主機。 當實作仍能確定路由時,例如透過對預設目標或檢查請求,則可接受 null 。
- request
- IHttpRequest
執行請求。
- responseHandler
- IResponseHandler
回應處理器。
- context
- IHttpContext
執行時要用的上下文,或 null 是使用預設上下文。
傳回
由回應處理器產生的回應物件。
- 屬性
備註
此頁面的部分是根據 Android 開放原始碼專案所建立和共用的工作進行修改,並根據 Creative Commons 2.5 屬性授權中所述的詞彙使用。