HttpClient.PutAsync(Uri, IHttpContent) メソッド

定義

指定された URI に PUT 要求を非同期操作として送信します。 HttpClient クラスのプログラミング ガイダンスとコード例については、HttpClient の概念に関するトピックを参照してください。

public:
 virtual IAsyncOperationWithProgress<HttpResponseMessage ^, HttpProgress> ^ PutAsync(Uri ^ uri, IHttpContent ^ content) = PutAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperationWithProgress<HttpResponseMessage, HttpProgress> PutAsync(Uri const& uri, IHttpContent const& content);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperationWithProgress<HttpResponseMessage,HttpProgress> PutAsync(System.Uri uri, IHttpContent content);
function putAsync(uri, content)
Public Function PutAsync (uri As Uri, content As IHttpContent) As IAsyncOperationWithProgress(Of HttpResponseMessage, HttpProgress)

パラメーター

uri
Uri Uri

要求の送信先 URI。

content
IHttpContent

サーバーに送信する HTTP 要求コンテンツ。

戻り値

非同期操作を表す オブジェクト。

属性

注釈

この操作はブロックされません。 返された IAsyncOperationWithProgress ( HttpResponseMessageHttpProgress の) は、応答全体 (コンテンツを含む) が読み取られた後に完了します。

PutAsync メソッドと PostAsync メソッドでは、限られた数の HTTP コンテンツ ヘッダーのみを設定できます。 これに対し、 SendRequestAsync メソッドを使用すると、要求メッセージと送信する HTTP コンテンツのヘッダーを設定できます。

この関数がスローする例外を次に示します。

E_INVALIDARG

uri パラメーターは null 参照でした (Visual Basic では Nothing)。

適用対象

こちらもご覧ください