AngleSharp by AngleSharp

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

.NET API 1,230,848 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 defaultValue = MimeTypeNames.FromExtension((num >= 0) ? path.Substring(num) : ".a"); return new MimeType(response.Headers.GetOrDefault(HeaderNames.ContentType, defaultValue)); } public static MimeType GetContentType(this IResponse response, string defaultType) { string path = response.Address.Path; int num = path.LastIndexOf('.'); if (num >= 0) defaultType = MimeTypeNames.FromExtension(path.Substring(num)); return new MimeType(response.Headers.GetOrDefault(HeaderNames.ContentType, defaultType)); } } }