Пример #1
0
 public static Task <byte[]> GetBytesAsync(
     this HttpService http, string url, CancellationToken cancellationToken,
     CacheMode?cache = null, string?cacheKey = null, bool?repeat = null, int?timeoutSeconds = null) =>
 http.GetBytesAsync(new Uri(url), cancellationToken,
                    cache: cache, cacheKey: cacheKey, repeat: repeat, timeoutSeconds: timeoutSeconds);
Пример #2
0
 public static byte[] GetBytes(
     this HttpService http, Uri uri,
     CacheMode?cache = null, string?cacheKey = null, bool?repeat = null, int?timeoutSeconds = null) =>
 Task.Run(() => http.GetBytesAsync(uri, Kit.CancellationToken,
                                   cache: cache, cacheKey: cacheKey, repeat: repeat, timeoutSeconds: timeoutSeconds)).Result;