diff --git a/src/fsharp/FSharp.Core/async.fsi b/src/fsharp/FSharp.Core/async.fsi index d127f6f6380..fe7f2a59807 100644 --- a/src/fsharp/FSharp.Core/async.fsi +++ b/src/fsharp/FSharp.Core/async.fsi @@ -1072,7 +1072,18 @@ namespace Microsoft.FSharp.Control /// Returns an asynchronous computation that, when run, will wait for a response to the given WebRequest. /// An asynchronous computation that waits for response to the WebRequest. /// - /// + /// + /// + /// open System.Net + /// open System.IO + /// let responseStreamToString = fun (responseStream : WebResponse) -> + /// let reader = new StreamReader(responseStream.GetResponseStream()) + /// reader.ReadToEnd() + /// let webRequest = WebRequest.Create("https://www.w3.org") + /// let result = webRequest.AsyncGetResponse() |> Async.RunSynchronously |> responseStreamToString + /// + /// + /// Gets the web response asynchronously and converts response stream to string [] // give the extension member a nice, unmangled compiled name, unique within this module member AsyncGetResponse : unit -> Async @@ -1084,7 +1095,14 @@ namespace Microsoft.FSharp.Control /// /// An asynchronous computation that will wait for the download of the URI. /// - /// + /// + /// + /// open System + /// let client = new WebClient() + /// Uri("https://www.w3.org") |> client.AsyncDownloadString |> Async.RunSynchronously + /// + /// This will download the server response from https://www.w3.org + /// [] // give the extension member a nice, unmangled compiled name, unique within this module member AsyncDownloadString : address:System.Uri -> Async @@ -1094,7 +1112,16 @@ namespace Microsoft.FSharp.Control /// /// An asynchronous computation that will wait for the download of the URI. /// - /// + /// + /// + /// open System.Net + /// open System.Text + /// open System + /// let client = new WebClient() + /// client.AsyncDownloadData(Uri("https://www.w3.org")) |> Async.RunSynchronously |> Encoding.ASCII.GetString + /// + /// + /// Downloads the data in bytes and decodes it to a string. [] // give the extension member a nice, unmangled compiled name, unique within this module member AsyncDownloadData : address:System.Uri -> Async @@ -1105,7 +1132,15 @@ namespace Microsoft.FSharp.Control /// /// An asynchronous computation that will wait for the download of the URI to specified file. /// - /// + /// + /// + /// open System.Net + /// open System + /// let client = new WebClient() + /// Uri("https://www.w3.com") |> fun x -> client.AsyncDownloadFile(x, "output.html") |> Async.RunSynchronouslyl + /// + /// This will download the server response as a file and output it as output.html + /// [] // give the extension member a nice, unmangled compiled name, unique within this module member AsyncDownloadFile : address:System.Uri * fileName: string -> Async