diff --git a/samples/snippets/fsharp/lang-ref-2/snippet8003.fs b/samples/snippets/fsharp/lang-ref-2/snippet8003.fs index 413f87b2a126c..bbeb2732ae1e8 100644 --- a/samples/snippets/fsharp/lang-ref-2/snippet8003.fs +++ b/samples/snippets/fsharp/lang-ref-2/snippet8003.fs @@ -1,5 +1,6 @@ open System.Net open Microsoft.FSharp.Control.WebExtensions +open System.Net.Http let urlList = [ "Microsoft.com", "http://www.microsoft.com/" "MSDN", "http://msdn.microsoft.com/" @@ -10,8 +11,8 @@ let fetchAsync(name, url:string) = async { try let uri = new System.Uri(url) - let webClient = new WebClient() - let! html = webClient.AsyncDownloadString(uri) + let httpClient = new HttpClient() + let! html = httpClient.GetStringAsync(uri) |> Async.AwaitTask printfn "Read %d characters for %s" html.Length name with | ex -> printfn "%s" (ex.Message); @@ -24,4 +25,4 @@ let runAll() = |> Async.RunSynchronously |> ignore -runAll() \ No newline at end of file +runAll()