The GetContentType method returns the MIME type
reported by the server in the Content-Type response header
for the most recent navigation. This value reflects the server's
indication of what kind of content is being delivered, such as
"text/html", "application/pdf",
or "image/png". The returned string is preserved
until the next navigation begins, even if the document is cleared or
headers are reset.
It is important to note that not all servers will provide a
Content-Type header. Some intentionally omit this information
in combination with a X-Content-Type-Options: nosniff
header as a security measure to prevent the client from "sniffing" or
inferring the type. In such cases, GetContentType will
return an empty string. Applications should be prepared for this scenario
and not assume a value will always be available.
This method is a convenience wrapper around the underlying
response header and is useful for distinguishing whether the WebView
is rendering standard HTML or other document types. If more detailed
information is needed about the response, developers can enumerate the
response headers directly using GetFirstHeader and
GetNextHeader.