Here are the examples of the csharp api Neon.Xunit.TestHttpClient.GetSingleUseClient() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
30 Examples
19
Source : TestHttpClient.cs
with Apache License 2.0
from nforgeio
with Apache License 2.0
from nforgeio
public async Task<HttpResponseMessage> DeleteAsync(Uri requestUri, CancellationToken cancellationToken)
{
await SyncContext.ClearAsync;
if (disableConnectionReuse)
{
using (var client = GetSingleUseClient())
{
return await client.DeleteAsync(requestUri, cancellationToken);
}
}
else
{
return await client.DeleteAsync(requestUri, cancellationToken);
}
}
19
Source : TestHttpClient.cs
with Apache License 2.0
from nforgeio
with Apache License 2.0
from nforgeio
public async Task<HttpResponseMessage> DeleteAsync(string requestUri, CancellationToken cancellationToken)
{
await SyncContext.ClearAsync;
if (disableConnectionReuse)
{
using (var client = GetSingleUseClient())
{
return await client.DeleteAsync(requestUri, cancellationToken);
}
}
else
{
return await client.DeleteAsync(requestUri, cancellationToken);
}
}
19
Source : TestHttpClient.cs
with Apache License 2.0
from nforgeio
with Apache License 2.0
from nforgeio
public async Task<HttpResponseMessage> DeleteAsync(Uri requestUri)
{
await SyncContext.ClearAsync;
if (disableConnectionReuse)
{
using (var client = GetSingleUseClient())
{
return await client.DeleteAsync(requestUri);
}
}
else
{
return await client.DeleteAsync(requestUri);
}
}
19
Source : TestHttpClient.cs
with Apache License 2.0
from nforgeio
with Apache License 2.0
from nforgeio
public async Task<HttpResponseMessage> DeleteAsync(string requestUri)
{
await SyncContext.ClearAsync;
if (disableConnectionReuse)
{
using (var client = GetSingleUseClient())
{
return await client.DeleteAsync(requestUri);
}
}
else
{
return await client.DeleteAsync(requestUri);
}
}
19
Source : TestHttpClient.cs
with Apache License 2.0
from nforgeio
with Apache License 2.0
from nforgeio
public async Task<HttpResponseMessage> GetAsync(string requestUri)
{
await SyncContext.ClearAsync;
if (disableConnectionReuse)
{
using (var client = GetSingleUseClient())
{
return await client.GetAsync(requestUri);
}
}
else
{
return await client.GetAsync(requestUri);
}
}
19
Source : TestHttpClient.cs
with Apache License 2.0
from nforgeio
with Apache License 2.0
from nforgeio
public async Task<HttpResponseMessage> GetAsync(string requestUri, HttpCompletionOption completionOption)
{
await SyncContext.ClearAsync;
if (disableConnectionReuse)
{
using (var client = GetSingleUseClient())
{
return await client.GetAsync(requestUri, completionOption);
}
}
else
{
return await client.GetAsync(requestUri, completionOption);
}
}
19
Source : TestHttpClient.cs
with Apache License 2.0
from nforgeio
with Apache License 2.0
from nforgeio
public async Task<HttpResponseMessage> GetAsync(string requestUri, HttpCompletionOption completionOption, CancellationToken cancellationToken)
{
await SyncContext.ClearAsync;
if (disableConnectionReuse)
{
using (var client = GetSingleUseClient())
{
return await client.GetAsync(requestUri, completionOption, cancellationToken);
}
}
else
{
return await client.GetAsync(requestUri, completionOption, cancellationToken);
}
}
19
Source : TestHttpClient.cs
with Apache License 2.0
from nforgeio
with Apache License 2.0
from nforgeio
public async Task<HttpResponseMessage> GetAsync(string requestUri, CancellationToken cancellationToken)
{
await SyncContext.ClearAsync;
if (disableConnectionReuse)
{
using (var client = GetSingleUseClient())
{
return await client.GetAsync(requestUri, cancellationToken);
}
}
else
{
return await client.GetAsync(requestUri, cancellationToken);
}
}
19
Source : TestHttpClient.cs
with Apache License 2.0
from nforgeio
with Apache License 2.0
from nforgeio
public async Task<HttpResponseMessage> GetAsync(Uri requestUri)
{
await SyncContext.ClearAsync;
if (disableConnectionReuse)
{
using (var client = GetSingleUseClient())
{
return await client.GetAsync(requestUri);
}
}
else
{
return await client.GetAsync(requestUri);
}
}
19
Source : TestHttpClient.cs
with Apache License 2.0
from nforgeio
with Apache License 2.0
from nforgeio
public async Task<HttpResponseMessage> GetAsync(Uri requestUri, HttpCompletionOption completionOption)
{
await SyncContext.ClearAsync;
if (disableConnectionReuse)
{
using (var client = GetSingleUseClient())
{
return await client.GetAsync(requestUri, completionOption);
}
}
else
{
return await client.GetAsync(requestUri, completionOption);
}
}
19
Source : TestHttpClient.cs
with Apache License 2.0
from nforgeio
with Apache License 2.0
from nforgeio
public async Task<HttpResponseMessage> GetAsync(Uri requestUri, HttpCompletionOption completionOption, CancellationToken cancellationToken)
{
await SyncContext.ClearAsync;
if (disableConnectionReuse)
{
using (var client = GetSingleUseClient())
{
return await client.GetAsync(requestUri, completionOption, cancellationToken);
}
}
else
{
return await client.GetAsync(requestUri, completionOption, cancellationToken);
}
}
19
Source : TestHttpClient.cs
with Apache License 2.0
from nforgeio
with Apache License 2.0
from nforgeio
public async Task<HttpResponseMessage> GetAsync(Uri requestUri, CancellationToken cancellationToken)
{
await SyncContext.ClearAsync;
if (disableConnectionReuse)
{
using (var client = GetSingleUseClient())
{
return await client.GetAsync(requestUri, cancellationToken);
}
}
else
{
return await client.GetAsync(requestUri, cancellationToken);
}
}
19
Source : TestHttpClient.cs
with Apache License 2.0
from nforgeio
with Apache License 2.0
from nforgeio
public async Task<byte[]> GetByteArrayAsync(string requestUri)
{
await SyncContext.ClearAsync;
if (disableConnectionReuse)
{
using (var client = GetSingleUseClient())
{
return await client.GetByteArrayAsync(requestUri);
}
}
else
{
return await client.GetByteArrayAsync(requestUri);
}
}
19
Source : TestHttpClient.cs
with Apache License 2.0
from nforgeio
with Apache License 2.0
from nforgeio
public async Task<byte[]> GetByteArrayAsync(Uri requestUri)
{
await SyncContext.ClearAsync;
if (disableConnectionReuse)
{
using (var client = GetSingleUseClient())
{
return await client.GetByteArrayAsync(requestUri);
}
}
else
{
return await client.GetByteArrayAsync(requestUri);
}
}
19
Source : TestHttpClient.cs
with Apache License 2.0
from nforgeio
with Apache License 2.0
from nforgeio
public async Task<Stream> GetStreamAsync(string requestUri)
{
await SyncContext.ClearAsync;
if (disableConnectionReuse)
{
using (var client = GetSingleUseClient())
{
return await client.GetStreamAsync(requestUri);
}
}
else
{
return await client.GetStreamAsync(requestUri);
}
}
19
Source : TestHttpClient.cs
with Apache License 2.0
from nforgeio
with Apache License 2.0
from nforgeio
public async Task<Stream> GetStreamAsync(Uri requestUri)
{
await SyncContext.ClearAsync;
if (disableConnectionReuse)
{
using (var client = GetSingleUseClient())
{
return await client.GetStreamAsync(requestUri);
}
}
else
{
return await client.GetStreamAsync(requestUri);
}
}
19
Source : TestHttpClient.cs
with Apache License 2.0
from nforgeio
with Apache License 2.0
from nforgeio
public async Task<string> GetStringAsync(string requestUri)
{
await SyncContext.ClearAsync;
if (disableConnectionReuse)
{
using (var client = GetSingleUseClient())
{
return await client.GetStringAsync(requestUri);
}
}
else
{
return await client.GetStringAsync(requestUri);
}
}
19
Source : TestHttpClient.cs
with Apache License 2.0
from nforgeio
with Apache License 2.0
from nforgeio
public async Task<string> GetStringAsync(Uri requestUri)
{
await SyncContext.ClearAsync;
if (disableConnectionReuse)
{
using (var client = GetSingleUseClient())
{
return await client.GetStringAsync(requestUri);
}
}
else
{
return await client.GetStringAsync(requestUri);
}
}
19
Source : TestHttpClient.cs
with Apache License 2.0
from nforgeio
with Apache License 2.0
from nforgeio
public async Task<HttpResponseMessage> PostAsync(string requestUri, HttpContent content)
{
await SyncContext.ClearAsync;
if (disableConnectionReuse)
{
using (var client = GetSingleUseClient())
{
return await client.PostAsync(requestUri, content);
}
}
else
{
return await client.PostAsync(requestUri, content);
}
}
19
Source : TestHttpClient.cs
with Apache License 2.0
from nforgeio
with Apache License 2.0
from nforgeio
public async Task<HttpResponseMessage> PostAsync(string requestUri, HttpContent content, CancellationToken cancellationToken)
{
await SyncContext.ClearAsync;
if (disableConnectionReuse)
{
using (var client = GetSingleUseClient())
{
return await client.PostAsync(requestUri, content, cancellationToken);
}
}
else
{
return await client.PostAsync(requestUri, content, cancellationToken);
}
}
19
Source : TestHttpClient.cs
with Apache License 2.0
from nforgeio
with Apache License 2.0
from nforgeio
public async Task<HttpResponseMessage> PostAsync(Uri requestUri, HttpContent content)
{
await SyncContext.ClearAsync;
if (disableConnectionReuse)
{
using (var client = GetSingleUseClient())
{
return await client.PostAsync(requestUri, content);
}
}
else
{
return await client.PostAsync(requestUri, content);
}
}
19
Source : TestHttpClient.cs
with Apache License 2.0
from nforgeio
with Apache License 2.0
from nforgeio
public async Task<HttpResponseMessage> PostAsync(Uri requestUri, HttpContent content, CancellationToken cancellationToken)
{
await SyncContext.ClearAsync;
if (disableConnectionReuse)
{
using (var client = GetSingleUseClient())
{
return await client.PostAsync(requestUri, content, cancellationToken);
}
}
else
{
return await client.PostAsync(requestUri, content, cancellationToken);
}
}
19
Source : TestHttpClient.cs
with Apache License 2.0
from nforgeio
with Apache License 2.0
from nforgeio
public async Task<HttpResponseMessage> PutAsync(string requestUri, HttpContent content)
{
await SyncContext.ClearAsync;
if (disableConnectionReuse)
{
using (var client = GetSingleUseClient())
{
return await client.PutAsync(requestUri, content);
}
}
else
{
return await client.PutAsync(requestUri, content);
}
}
19
Source : TestHttpClient.cs
with Apache License 2.0
from nforgeio
with Apache License 2.0
from nforgeio
public async Task<HttpResponseMessage> PutAsync(string requestUri, HttpContent content, CancellationToken cancellationToken)
{
await SyncContext.ClearAsync;
if (disableConnectionReuse)
{
using (var client = GetSingleUseClient())
{
return await client.PutAsync(requestUri, content, cancellationToken);
}
}
else
{
return await client.PutAsync(requestUri, content, cancellationToken);
}
}
19
Source : TestHttpClient.cs
with Apache License 2.0
from nforgeio
with Apache License 2.0
from nforgeio
public async Task<HttpResponseMessage> PutAsync(Uri requestUri, HttpContent content)
{
await SyncContext.ClearAsync;
if (disableConnectionReuse)
{
using (var client = GetSingleUseClient())
{
return await client.PutAsync(requestUri, content);
}
}
else
{
return await client.PutAsync(requestUri, content);
}
}
19
Source : TestHttpClient.cs
with Apache License 2.0
from nforgeio
with Apache License 2.0
from nforgeio
public async Task<HttpResponseMessage> PutAsync(Uri requestUri, HttpContent content, CancellationToken cancellationToken)
{
await SyncContext.ClearAsync;
if (disableConnectionReuse)
{
using (var client = GetSingleUseClient())
{
return await client.PutAsync(requestUri, content, cancellationToken);
}
}
else
{
return await client.PutAsync(requestUri, content, cancellationToken);
}
}
19
Source : TestHttpClient.cs
with Apache License 2.0
from nforgeio
with Apache License 2.0
from nforgeio
public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request)
{
await SyncContext.ClearAsync;
if (disableConnectionReuse)
{
using (var client = GetSingleUseClient())
{
return await client.SendAsync(request);
}
}
else
{
return await client.SendAsync(request);
}
}
19
Source : TestHttpClient.cs
with Apache License 2.0
from nforgeio
with Apache License 2.0
from nforgeio
public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption)
{
await SyncContext.ClearAsync;
if (disableConnectionReuse)
{
using (var client = GetSingleUseClient())
{
return await client.SendAsync(request, completionOption);
}
}
else
{
return await client.SendAsync(request, completionOption);
}
}
19
Source : TestHttpClient.cs
with Apache License 2.0
from nforgeio
with Apache License 2.0
from nforgeio
public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
{
await SyncContext.ClearAsync;
if (disableConnectionReuse)
{
using (var client = GetSingleUseClient())
{
return await client.SendAsync(request, completionOption, cancellationToken);
}
}
else
{
return await client.SendAsync(request, completionOption, cancellationToken);
}
}
19
Source : TestHttpClient.cs
with Apache License 2.0
from nforgeio
with Apache License 2.0
from nforgeio
public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
await SyncContext.ClearAsync;
if (disableConnectionReuse)
{
using (var client = GetSingleUseClient())
{
return await client.SendAsync(request, cancellationToken);
}
}
else
{
return await client.SendAsync(request, cancellationToken);
}
}