I'm a newbie to F# and so I've written a small extension method library to practice the language.  The extension method attempts to determine if a url string is for an image.  I wrote the code as an extension method so that it can be used as an extension or static method in other .net languages, namely C#.    The code first checks the url's extension to see if a guess can be made about its content.  If no guess can be made, then the image is requested and the content type in the response's header is checked.Any advice, refactorings, or criticisms welcome.Thanks!namespace IsImageUrlDotNetopen System.Netopen Systemopen System.IO[<System.Runtime.CompilerServices.Extension>]module IsImageUrlDotNetLib =       let ImageFileExtensions = [png; jpg; gif; raw;bmp; svg; jpeg; psd;]    let NonImageFileExtensions = [exe; pdf; html; htm; txt; mp3; wav; odp;]    let private hasAFileExtensionInList(fileExtensionList:string list) (url:string) =      if Path.HasExtension url = false then         false      else           let urlSplitList = url.ToLower().Split '.'         let lastExtension = urlSplitList.[urlSplitList.Length - 1]         List.contains lastExtension fileExtensionList    let private hasAnImageFileExtension(url:string) =      hasAFileExtensionInList ImageFileExtensions url    let private hasAnNonImageFileExtension(url:string) =      hasAFileExtensionInList NonImageFileExtensions url    let private requestUrlAndCheckIfImage(url:string) =        let req = WebRequest.Create(Uri(url))         use resp = req.GetResponse()         let contentType = resp.ContentType        if contentType.Contains(text/html) then           false        else            contentType.Contains(image)    [<System.Runtime.CompilerServices.Extension>]       let IsImageUrl(opt:string) =                      match opt with        | null |  -> false        | url when Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute) = false -> false        | url when hasAnImageFileExtension url -> true         | url when hasAnNonImageFileExtension url -> false         | _ -> requestUrlAndCheckIfImage opt      Sample Test (C#):[TestMethod]public void ShouldBeAbleToIdentifyACommonImageUrl(){    const string CommonImageUrl = https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png;    var isImage = CommonImageUrl.IsImageUrl();    Assert.IsTrue(isImage);}
IsImageUrl extension method written in F#
image;f#;url