CachedHttpClient
Assembly: ServiceStack.HttpClient.dll
Declaration
public class CachedHttpClient : ICachedServiceClient, IServiceClient, IRestServiceClient, IServiceClientAsync, IServiceGatewayAsync, IServiceClientSync, IHasSessionId, IHasBearerToken, IHasVersion, IHttpRestClientAsync, IRestClientAsync, IReplyClient, IServiceGateway, IOneWayClient, IRestClient, IRestClientSync, IServiceClientCommon, IDisposable
Properties
ClearCachesOlderThan
Declaration
public TimeSpan? ClearCachesOlderThan { get; set; }
ClearExpiredCachesOlderThan
Declaration
public TimeSpan? ClearExpiredCachesOlderThan { get; set; }
CleanCachesWhenCountExceeds
Declaration
public int CleanCachesWhenCountExceeds { get; set; }
CacheCount
Declaration
public int CacheCount { get; }
CacheHits
Declaration
public long CacheHits { get; }
NotModifiedHits
Declaration
public long NotModifiedHits { get; }
ErrorFallbackHits
Declaration
public long ErrorFallbackHits { get; }
CachesAdded
Declaration
public long CachesAdded { get; }
CachesRemoved
Declaration
public long CachesRemoved { get; }
SessionId
Declaration
public string SessionId { get; set; }
BearerToken
Declaration
public string BearerToken { get; set; }
Version
Declaration
public int Version { get; set; }
Methods
OnExceptionFilter(HttpResponseMessage, String, Type)
Declaration
public object OnExceptionFilter(HttpResponseMessage webRes, string requestUri, Type responseType)
Returns
System.Object
Parameters
Type | Name |
---|
System.Net.Http.HttpResponseMessage | webRes |
System.String | requestUri |
System.Type | responseType |
SetCache(ConcurrentDictionary<String, HttpCacheEntry>)
Declaration
public void SetCache(ConcurrentDictionary<string, HttpCacheEntry> cache)
Parameters
Type | Name |
---|
System.Collections.Concurrent.ConcurrentDictionary<System.String,ServiceStack.HttpCacheEntry> | cache |
RemoveCachesOlderThan(TimeSpan)
Declaration
public int RemoveCachesOlderThan(TimeSpan age)
Returns
System.Int32
Parameters
Type | Name |
---|
System.TimeSpan | age |
RemoveExpiredCachesOlderThan(TimeSpan)
Declaration
public int RemoveExpiredCachesOlderThan(TimeSpan age)
Returns
System.Int32
Parameters
Type | Name |
---|
System.TimeSpan | age |
Dispose()
SetCredentials(String, String)
Declaration
public void SetCredentials(string userName, string password)
Parameters
Type | Name |
---|
System.String | userName |
System.String | password |
GetAsync<TResponse>(IReturn<TResponse>, CancellationToken)
Declaration
public Task<TResponse> GetAsync<TResponse>(IReturn<TResponse> requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type Parameters
GetAsync<TResponse>(Object, CancellationToken)
Declaration
public Task<TResponse> GetAsync<TResponse>(object requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|
System.Object | requestDto |
System.Threading.CancellationToken | token |
Type Parameters
GetAsync<TResponse>(String, CancellationToken)
Declaration
public Task<TResponse> GetAsync<TResponse>(string relativeOrAbsoluteUrl, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|
System.String | relativeOrAbsoluteUrl |
System.Threading.CancellationToken | token |
Type Parameters
GetAsync(IReturnVoid, CancellationToken)
Declaration
public Task GetAsync(IReturnVoid requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
DeleteAsync<TResponse>(IReturn<TResponse>, CancellationToken)
Declaration
public Task<TResponse> DeleteAsync<TResponse>(IReturn<TResponse> requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type Parameters
DeleteAsync<TResponse>(Object, CancellationToken)
Declaration
public Task<TResponse> DeleteAsync<TResponse>(object requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|
System.Object | requestDto |
System.Threading.CancellationToken | token |
Type Parameters
DeleteAsync<TResponse>(String, CancellationToken)
Declaration
public Task<TResponse> DeleteAsync<TResponse>(string relativeOrAbsoluteUrl, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|
System.String | relativeOrAbsoluteUrl |
System.Threading.CancellationToken | token |
Type Parameters
DeleteAsync(IReturnVoid, CancellationToken)
Declaration
public Task DeleteAsync(IReturnVoid requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
PostAsync<TResponse>(IReturn<TResponse>, CancellationToken)
Declaration
public Task<TResponse> PostAsync<TResponse>(IReturn<TResponse> requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type Parameters
PostAsync<TResponse>(Object, CancellationToken)
Declaration
public Task<TResponse> PostAsync<TResponse>(object requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|
System.Object | requestDto |
System.Threading.CancellationToken | token |
Type Parameters
PostAsync<TResponse>(String, Object, CancellationToken)
Declaration
public Task<TResponse> PostAsync<TResponse>(string relativeOrAbsoluteUrl, object request, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|
System.String | relativeOrAbsoluteUrl |
System.Object | request |
System.Threading.CancellationToken | token |
Type Parameters
PostAsync(IReturnVoid, CancellationToken)
Declaration
public Task PostAsync(IReturnVoid requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
PutAsync<TResponse>(IReturn<TResponse>, CancellationToken)
Declaration
public Task<TResponse> PutAsync<TResponse>(IReturn<TResponse> requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type Parameters
PutAsync<TResponse>(Object, CancellationToken)
Declaration
public Task<TResponse> PutAsync<TResponse>(object requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|
System.Object | requestDto |
System.Threading.CancellationToken | token |
Type Parameters
PutAsync<TResponse>(String, Object, CancellationToken)
Declaration
public Task<TResponse> PutAsync<TResponse>(string relativeOrAbsoluteUrl, object request, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|
System.String | relativeOrAbsoluteUrl |
System.Object | request |
System.Threading.CancellationToken | token |
Type Parameters
PutAsync(IReturnVoid, CancellationToken)
Declaration
public Task PutAsync(IReturnVoid requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
PatchAsync<TResponse>(IReturn<TResponse>, CancellationToken)
Declaration
public Task<TResponse> PatchAsync<TResponse>(IReturn<TResponse> requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type Parameters
PatchAsync<TResponse>(Object, CancellationToken)
Declaration
public Task<TResponse> PatchAsync<TResponse>(object requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|
System.Object | requestDto |
System.Threading.CancellationToken | token |
Type Parameters
PatchAsync(IReturnVoid, CancellationToken)
Declaration
public Task PatchAsync(IReturnVoid requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
SendAsync<TResponse>(String, String, Object, CancellationToken)
Declaration
public Task<TResponse> SendAsync<TResponse>(string httpMethod, string absoluteUrl, object request, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|
System.String | httpMethod |
System.String | absoluteUrl |
System.Object | request |
System.Threading.CancellationToken | token |
Type Parameters
CustomMethodAsync<TResponse>(String, IReturn<TResponse>, CancellationToken)
Declaration
public Task<TResponse> CustomMethodAsync<TResponse>(string httpVerb, IReturn<TResponse> requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type Parameters
CustomMethodAsync<TResponse>(String, Object, CancellationToken)
Declaration
public Task<TResponse> CustomMethodAsync<TResponse>(string httpVerb, object requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|
System.String | httpVerb |
System.Object | requestDto |
System.Threading.CancellationToken | token |
Type Parameters
CustomMethodAsync(String, IReturnVoid, CancellationToken)
Declaration
public Task CustomMethodAsync(string httpVerb, IReturnVoid requestDto, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
CustomMethodAsync<TResponse>(String, String, Object, CancellationToken)
Declaration
public Task<TResponse> CustomMethodAsync<TResponse>(string httpVerb, string relativeOrAbsoluteUrl, object request, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|
System.String | httpVerb |
System.String | relativeOrAbsoluteUrl |
System.Object | request |
System.Threading.CancellationToken | token |
Type Parameters
CancelAsync()
Declaration
public void CancelAsync()
SendOneWay(Object)
Declaration
public void SendOneWay(object requestDto)
Parameters
Type | Name |
---|
System.Object | requestDto |
SendOneWay(String, Object)
Declaration
public void SendOneWay(string relativeOrAbsoluteUri, object requestDto)
Parameters
Type | Name |
---|
System.String | relativeOrAbsoluteUri |
System.Object | requestDto |
SendAllOneWay(IEnumerable<Object>)
Declaration
public void SendAllOneWay(IEnumerable<object> requests)
Parameters
Type | Name |
---|
System.Collections.Generic.IEnumerable<System.Object> | requests |
Declaration
public void AddHeader(string name, string value)
Parameters
Type | Name |
---|
System.String | name |
System.String | value |
ClearCookies()
Declaration
public void ClearCookies()
GetCookieValues()
Declaration
public Dictionary<string, string> GetCookieValues()
Returns
System.Collections.Generic.Dictionary<System.String,System.String>
SetCookie(String, String, Nullable<TimeSpan>)
Declaration
public void SetCookie(string name, string value, TimeSpan? expiresIn = null)
Parameters
Type | Name |
---|
System.String | name |
System.String | value |
System.Nullable<System.TimeSpan> | expiresIn |
Get(IReturnVoid)
Declaration
public void Get(IReturnVoid request)
Parameters
Get<TResponse>(IReturn<TResponse>)
Declaration
public TResponse Get<TResponse>(IReturn<TResponse> requestDto)
Returns
<TResponse>
Parameters
Type Parameters
Get<TResponse>(Object)
Declaration
public TResponse Get<TResponse>(object requestDto)
Returns
<TResponse>
Parameters
Type | Name |
---|
System.Object | requestDto |
Type Parameters
Get<TResponse>(String)
Declaration
public TResponse Get<TResponse>(string relativeOrAbsoluteUrl)
Returns
<TResponse>
Parameters
Type | Name |
---|
System.String | relativeOrAbsoluteUrl |
Type Parameters
GetLazy<TResponse>(IReturn<QueryResponse<TResponse>>)
Declaration
public IEnumerable<TResponse> GetLazy<TResponse>(IReturn<QueryResponse<TResponse>> queryDto)
Returns
System.Collections.Generic.IEnumerable<<TResponse>>
Parameters
Type Parameters
Delete(IReturnVoid)
Declaration
public void Delete(IReturnVoid requestDto)
Parameters
Delete<TResponse>(IReturn<TResponse>)
Declaration
public TResponse Delete<TResponse>(IReturn<TResponse> request)
Returns
<TResponse>
Parameters
Type Parameters
Delete<TResponse>(Object)
Declaration
public TResponse Delete<TResponse>(object request)
Returns
<TResponse>
Parameters
Type | Name |
---|
System.Object | request |
Type Parameters
Delete<TResponse>(String)
Declaration
public TResponse Delete<TResponse>(string relativeOrAbsoluteUrl)
Returns
<TResponse>
Parameters
Type | Name |
---|
System.String | relativeOrAbsoluteUrl |
Type Parameters
Post(IReturnVoid)
Declaration
public void Post(IReturnVoid requestDto)
Parameters
Post<TResponse>(IReturn<TResponse>)
Declaration
public TResponse Post<TResponse>(IReturn<TResponse> requestDto)
Returns
<TResponse>
Parameters
Type Parameters
Post<TResponse>(Object)
Declaration
public TResponse Post<TResponse>(object requestDto)
Returns
<TResponse>
Parameters
Type | Name |
---|
System.Object | requestDto |
Type Parameters
Post<TResponse>(String, Object)
Declaration
public TResponse Post<TResponse>(string relativeOrAbsoluteUrl, object request)
Returns
<TResponse>
Parameters
Type | Name |
---|
System.String | relativeOrAbsoluteUrl |
System.Object | request |
Type Parameters
Put(IReturnVoid)
Declaration
public void Put(IReturnVoid requestDto)
Parameters
Put<TResponse>(IReturn<TResponse>)
Declaration
public TResponse Put<TResponse>(IReturn<TResponse> requestDto)
Returns
<TResponse>
Parameters
Type Parameters
Put<TResponse>(Object)
Declaration
public TResponse Put<TResponse>(object requestDto)
Returns
<TResponse>
Parameters
Type | Name |
---|
System.Object | requestDto |
Type Parameters
Put<TResponse>(String, Object)
Declaration
public TResponse Put<TResponse>(string relativeOrAbsoluteUrl, object requestDto)
Returns
<TResponse>
Parameters
Type | Name |
---|
System.String | relativeOrAbsoluteUrl |
System.Object | requestDto |
Type Parameters
Patch(IReturnVoid)
Declaration
public void Patch(IReturnVoid requestDto)
Parameters
Patch<TResponse>(IReturn<TResponse>)
Declaration
public TResponse Patch<TResponse>(IReturn<TResponse> requestDto)
Returns
<TResponse>
Parameters
Type Parameters
Patch<TResponse>(Object)
Declaration
public TResponse Patch<TResponse>(object requestDto)
Returns
<TResponse>
Parameters
Type | Name |
---|
System.Object | requestDto |
Type Parameters
Patch<TResponse>(String, Object)
Declaration
public TResponse Patch<TResponse>(string relativeOrAbsoluteUrl, object requestDto)
Returns
<TResponse>
Parameters
Type | Name |
---|
System.String | relativeOrAbsoluteUrl |
System.Object | requestDto |
Type Parameters
Send<TResponse>(String, String, Object)
Declaration
public TResponse Send<TResponse>(string httpMethod, string relativeOrAbsoluteUrl, object request)
Returns
<TResponse>
Parameters
Type | Name |
---|
System.String | httpMethod |
System.String | relativeOrAbsoluteUrl |
System.Object | request |
Type Parameters
CustomMethod(String, IReturnVoid)
Declaration
public void CustomMethod(string httpVerb, IReturnVoid requestDto)
Parameters
CustomMethod<TResponse>(String, IReturn<TResponse>)
Declaration
public TResponse CustomMethod<TResponse>(string httpVerb, IReturn<TResponse> requestDto)
Returns
<TResponse>
Parameters
Type Parameters
CustomMethod<TResponse>(String, Object)
Declaration
public TResponse CustomMethod<TResponse>(string httpVerb, object requestDto)
Returns
<TResponse>
Parameters
Type | Name |
---|
System.String | httpVerb |
System.Object | requestDto |
Type Parameters
PostFile<TResponse>(String, Stream, String, String, String)
Declaration
public TResponse PostFile<TResponse>(string relativeOrAbsoluteUrl, Stream fileToUpload, string fileName, string mimeType, string fieldName = "file")
Returns
<TResponse>
Parameters
Type | Name |
---|
System.String | relativeOrAbsoluteUrl |
System.IO.Stream | fileToUpload |
System.String | fileName |
System.String | mimeType |
System.String | fieldName |
Type Parameters
PostFileWithRequest<TResponse>(Stream, String, Object, String)
Declaration
public TResponse PostFileWithRequest<TResponse>(Stream fileToUpload, string fileName, object request, string fieldName = "file")
Returns
<TResponse>
Parameters
Type | Name |
---|
System.IO.Stream | fileToUpload |
System.String | fileName |
System.Object | request |
System.String | fieldName |
Type Parameters
PostFileWithRequest<TResponse>(String, Stream, String, Object, String)
Declaration
public TResponse PostFileWithRequest<TResponse>(string relativeOrAbsoluteUrl, Stream fileToUpload, string fileName, object request, string fieldName = "file")
Returns
<TResponse>
Parameters
Type | Name |
---|
System.String | relativeOrAbsoluteUrl |
System.IO.Stream | fileToUpload |
System.String | fileName |
System.Object | request |
System.String | fieldName |
Type Parameters
PostFilesWithRequest<TResponse>(Object, IEnumerable<UploadFile>)
Declaration
public TResponse PostFilesWithRequest<TResponse>(object request, IEnumerable<UploadFile> files)
Returns
<TResponse>
Parameters
Type | Name |
---|
System.Object | request |
System.Collections.Generic.IEnumerable<ServiceStack.UploadFile> | files |
Type Parameters
PostFilesWithRequest<TResponse>(String, Object, IEnumerable<UploadFile>)
Declaration
public TResponse PostFilesWithRequest<TResponse>(string relativeOrAbsoluteUrl, object request, IEnumerable<UploadFile> files)
Returns
<TResponse>
Parameters
Type | Name |
---|
System.String | relativeOrAbsoluteUrl |
System.Object | request |
System.Collections.Generic.IEnumerable<ServiceStack.UploadFile> | files |
Type Parameters
Send<TResponse>(Object)
Declaration
public TResponse Send<TResponse>(object request)
Returns
<TResponse>
Parameters
Type | Name |
---|
System.Object | request |
Type Parameters
SendAll<TResponse>(IEnumerable<Object>)
Declaration
public List<TResponse> SendAll<TResponse>(IEnumerable<object> requests)
Returns
System.Collections.Generic.List<<TResponse>>
Parameters
Type | Name |
---|
System.Collections.Generic.IEnumerable<System.Object> | requests |
Type Parameters
Publish(Object)
Declaration
public void Publish(object requestDto)
Parameters
Type | Name |
---|
System.Object | requestDto |
PublishAll(IEnumerable<Object>)
Declaration
public void PublishAll(IEnumerable<object> requestDtos)
Parameters
Type | Name |
---|
System.Collections.Generic.IEnumerable<System.Object> | requestDtos |
SendAsync<TResponse>(Object, CancellationToken)
Declaration
public Task<TResponse> SendAsync<TResponse>(object requestDto, CancellationToken token)
Returns
System.Threading.Tasks.Task<<TResponse>>
Parameters
Type | Name |
---|
System.Object | requestDto |
System.Threading.CancellationToken | token |
Type Parameters
SendAllAsync<TResponse>(IEnumerable<Object>, CancellationToken)
Declaration
public Task<List<TResponse>> SendAllAsync<TResponse>(IEnumerable<object> requests, CancellationToken token)
Returns
System.Threading.Tasks.Task<System.Collections.Generic.List<<TResponse>>>
Parameters
Type | Name |
---|
System.Collections.Generic.IEnumerable<System.Object> | requests |
System.Threading.CancellationToken | token |
Type Parameters
PublishAsync(Object, CancellationToken)
Declaration
public Task PublishAsync(object requestDto, CancellationToken token)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|
System.Object | requestDto |
System.Threading.CancellationToken | token |
PublishAllAsync(IEnumerable<Object>, CancellationToken)
Declaration
public Task PublishAllAsync(IEnumerable<object> requestDtos, CancellationToken token)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|
System.Collections.Generic.IEnumerable<System.Object> | requestDtos |
System.Threading.CancellationToken | token |
Implements