AngleSharp by AngleSharp

<PackageReference Include="AngleSharp" Version="0.9.6" />

.NET API 1,261,568 bytes

 ResponseExtensions

public static class ResponseExtensions
Represents some useful extensions for the response.
using AngleSharp.Network; namespace AngleSharp.Extensions { public static class ResponseExtensions { public static MimeType GetContentType(this IResponse response) { string path = response.Address.Path; int num = path.LastIndexOf('.'); string extension = (num >= 0) ? path.Substring(num) : ".a"; string defaultType = MimeTypeNames.FromExtension(extension); return response.GetContentType(defaultType); } public static MimeType GetContentType(this IResponse response, string defaultType) { return new MimeType(response.Headers.GetOrDefault(HeaderNames.ContentType, defaultType)); } } }