4using System.Security.Cryptography.X509Certificates;
5using System.Threading.Tasks;
26 public override string[]
UriSchemes =>
new string[] {
"http",
"https" };
36 switch (Uri.Scheme.ToLower())
58 public override async Task<ContentResponse>
DeleteAsync(Uri Uri, X509Certificate Certificate,
59 EventHandler<RemoteCertificateEventArgs> RemoteCertificateValidator,
int TimeoutMs, params KeyValuePair<string, string>[] Headers)
62 using (HttpClient HttpClient =
new HttpClient(Handler,
true)
64 Timeout = TimeSpan.FromMilliseconds(TimeoutMs)
67 using (HttpRequestMessage Request =
new HttpRequestMessage()
69 Method = HttpMethod.Delete
75 HttpResponseMessage Response = await HttpClient.SendAsync(Request);
Abstract base class for deleters.
Deletes to resources on the Web (i.e. using HTTP or HTTPS).
override bool CanDelete(Uri Uri, out Grade Grade)
If the deleter is able to delete to a resource, given its URI.
override async Task< ContentResponse > DeleteAsync(Uri Uri, X509Certificate Certificate, EventHandler< RemoteCertificateEventArgs > RemoteCertificateValidator, int TimeoutMs, params KeyValuePair< string, string >[] Headers)
Deletes a resource, using a Uniform Resource Identifier (or Locator).
override string[] UriSchemes
Supported URI schemes.
WebDeleter()
Deletes to resources on the Web (i.e. using HTTP or HTTPS).
Gets resources from the Web (i.e. using HTTP or HTTPS).
static async Task< ContentResponse > ProcessResponse(HttpResponseMessage Response, Uri Uri)
Decodes a response from the web. If the response is a success, the decoded response is returned....
static void PrepareHeaders(HttpRequestMessage Request, KeyValuePair< string, string >[] Headers, HttpClientHandler Handler)
Prepares headers for a HTTP request.
static HttpClientHandler GetClientHandler()
Gets a HTTP Client handler
static Uri CheckUri(Uri Uri, HttpRequestMessage Request)
Checks the URI, if it is suitable for processing, or if it needs to be modified.