For historical reasons (see Verification of an URL), the library provides a set of functions that may be used to query the HTTP meta-info headers (e.g. content-type, content-length) for an URL from the server. The file extension is determined from the returned content-type, and at best, only a guess.