/// <summary>Sends a PUT request as an asynchronous operation, with a specified value serialized using the given formatter and media type string. Includes a cancellation token to cancel the request.</summary> /// <returns>A task object representing the asynchronous operation.</returns> /// <param name="client">The client used to make the request.</param> /// <param name="requestUri">The URI the request is sent to.</param> /// <param name="value">The value to write into the entity body of the request.</param> /// <param name="formatter">The formatter used to serialize the value.</param> /// <param name="mediaType">The authoritative value of the Content-Type header. Can be null, in which case the default content type of the formatter will be used.</param> /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> /// <param name="options">The options for the request.</param> /// <typeparam name="T">The type of object to serialize.</typeparam> private static Task <HttpResponseMessage> PutAsync <T>(this HttpMessageInvoker client, string requestUri, T value, MediaTypeFormatter formatter, string mediaType, CancellationToken cancellationToken, RequestOptions options) { return(client.PutAsync(requestUri, value, formatter, ObjectContent.BuildHeaderValue(mediaType), cancellationToken, options)); }