sdk/dotnet/src/Microsoft.Datasync.Client/Http/ServiceHttpClient.cs
/// <summary>
/// Sends a request through the HTTP pipeline to the remote service asynchronously.
/// </summary>
/// <param name="requestMessage">The <see cref="HttpRequestMessage"/> to send to the service.</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> to observe.</param>
/// <returns>A task that returns a <see cref="HttpResponseMessage"/> when complete.</returns>
Sends a request through the HTTP pipeline to the remote service asynchronously.
Sends a request through the HTTP pipeline to the remote service asynchronously .
public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage requestMessage, CancellationToken cancellationToken = default)
        {
            Arguments.IsNotNull(requestMessage, nameof(requestMessage));
            try
            {
                return await client.SendAsync(requestMessage, cancellationToken).ConfigureAwait(false);
            }
            catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested)
            {
                throw new TimeoutException();
            }
        }
public async Task < HttpResponseMessage > SendAsync ( HttpRequestMessage requestMessage , CancellationToken cancellationToken = default ) { Arguments . IsNotNull ( requestMessage , nameof ( requestMessage ) ) ; try { return await client . SendAsync ( requestMessage , cancellationToken ) . ConfigureAwait ( false ) ; } catch ( OperationCanceledException ) when ( ! cancellationToken . IsCancellationRequested ) { throw new TimeoutException ( ) ; } }
Sends a request through the HTTP pipeline to the remote service asynchronously.
Sends a request through the HTTP pipeline to the remote service asynchronously .
A task that returns a  when complete.
A task that returns a when complete .
requestMessage
HttpRequestMessage
The  to send to the service.
The to send to the service .
cancellationToken
CancellationToken
A  to observe.
A to observe .