Class BaseLoader
- Namespace
- AngleSharp.Io
- Assembly
- AngleSharp.dll
Represents the base class for all loaders.
public abstract class BaseLoader : ILoader
- Inheritance
-
BaseLoader
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
BaseLoader(IBrowsingContext, Predicate<Request>?)
Creates a new resource loader.
public BaseLoader(IBrowsingContext context, Predicate<Request>? filter)
Parameters
context
IBrowsingContextThe context to use.
filter
Predicate<Request>The optional request filter to use.
Properties
MaxRedirects
Gets the maximum number of redirects. By default this is 50.
public int MaxRedirects { get; protected set; }
Property Value
Methods
Add(IDownload)
Adds the download to the active downloads.
protected virtual void Add(IDownload download)
Parameters
download
IDownloadThe download to add.
CreateNewRequest(Request, IResponse)
Creates a new request based on the existing request and given response.
protected static Request CreateNewRequest(Request request, IResponse response)
Parameters
Returns
- Request
The new request to issue.
DownloadAsync(Request, INode?)
Starts downloading the request.
protected virtual IDownload DownloadAsync(Request request, INode? originator)
Parameters
Returns
- IDownload
The active download.
GetCookie(Url)
Gets the cookie string for the given URL.
protected virtual string GetCookie(Url url)
Parameters
url
UrlThe requested URL.
Returns
- string
The associated cookie string, if any.
GetDownloads()
Gets the active downloads.
public IEnumerable<IDownload> GetDownloads()
Returns
- IEnumerable<IDownload>
The enumerable over all active downloads.
LoadAsync(Request, CancellationToken)
Loads the given URI by using an asynchronous request.
protected Task<IResponse> LoadAsync(Request request, CancellationToken cancel)
Parameters
request
RequestThe data of the request to send.
cancel
CancellationTokenThe cancellation token to use..
Returns
Remove(IDownload)
Removes the download from the active downloads.
protected virtual void Remove(IDownload download)
Parameters
download
IDownloadThe download to remove.
SetCookie(Url, string)
Sets the cookie string for the given URL.
protected virtual void SetCookie(Url url, string value)