},System.Boolean)} },System.Boolean)}
RelativeTimeDownloadExtensions.DownloadUrl(IBlobCache, string, HttpMethod, TimeSpan, IEnumerable>?, bool) method¶
Defined in
Type: RelativeTimeDownloadExtensions
Namespace: Akavache
Assembly: Akavache.HttpDownloader.dll
Applies to
net10.0, net10.0-tvos26.0, net10.0-maccatalyst26.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net10.0-android36.0, net10.0-ios26.0, net10.0-windows10.0.19041, net10.0-macos26.0, net9.0, net9.0-windows10.0.19041, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-windows10.0.19041, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net481, net462
Overloads¶
- 1.
public static IObservable<byte[]> DownloadUrl(this IBlobCache blobCache, string url, HttpMethod httpMethod, TimeSpan expiration, IEnumerable<KeyValuePair<string, string>>? headers = null, bool fetchAlways = false) - 2.
public static IObservable<byte[]> DownloadUrl(this IBlobCache blobCache, Uri url, HttpMethod httpMethod, TimeSpan expiration, IEnumerable<KeyValuePair<string, string>>? headers = null, bool fetchAlways = false)
1. Overload¶
public static IObservable<byte[]> DownloadUrl(this IBlobCache blobCache, string url, HttpMethod httpMethod, TimeSpan expiration, IEnumerable<KeyValuePair<string, string>>? headers = null, bool fetchAlways = false)
Summary: Downloads data from the specified URL if it is not already in the cache, with expiration based on a relative time span.
Parameters
| Name | Type | Description |
|---|---|---|
blobCache | [IBlobCache](# | The blob cache to store the downloaded data. |
url | string | The URL to download if not already in the cache. |
httpMethod | HttpMethod | The HTTP method to use for the request. |
expiration | TimeSpan | A time span that will be added to the current time to determine expiration. |
headers = null | IEnumerable | Optional HTTP headers to include in the request. |
fetchAlways = false | bool | A value indicating whether to always fetch from the web, bypassing the cache. |
Returns: IObservable
2. Overload¶
public static IObservable<byte[]> DownloadUrl(this IBlobCache blobCache, Uri url, HttpMethod httpMethod, TimeSpan expiration, IEnumerable<KeyValuePair<string, string>>? headers = null, bool fetchAlways = false)
Summary: Downloads data from the specified URL if it is not already in the cache, with expiration based on a relative time span.
Parameters
| Name | Type | Description |
|---|---|---|
blobCache | [IBlobCache](# | The blob cache to store the downloaded data. |
url | Uri | The URL to download if not already in the cache. |
httpMethod | HttpMethod | The HTTP method to use for the request. |
expiration | TimeSpan | A time span that will be added to the current time to determine expiration. |
headers = null | IEnumerable | Optional HTTP headers to include in the request. |
fetchAlways = false | bool | A value indicating whether to always fetch from the web, bypassing the cache. |
Returns: IObservable