-
Notifications
You must be signed in to change notification settings - Fork 786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added examples for Async.WebExtensions #12644
Conversation
src/fsharp/FSharp.Core/async.fsi
Outdated
/// <example-tbd></example-tbd> | ||
/// <example id="get-response"> | ||
/// <code lang="fsharp"> | ||
/// let responseStreamToString = fun (responseStream : System.Net.WebResponse) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can add open System
and open System.IO
and open System.Net
at the top of the sample I think. Best to keep the code crisp.
src/fsharp/FSharp.Core/async.fsi
Outdated
/// <example id="async-download-string"> | ||
/// <code lang="fsharp"> | ||
/// let client = new WebClient() | ||
/// System.Uri("https://www.microsoft.com") |> client.AsyncDownloadString |> Async.RunSynchronously |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to a more neutral URL like https://www.w3.org/
src/fsharp/FSharp.Core/async.fsi
Outdated
/// <example id="async-download-data"> | ||
/// <code lang="fsharp"> | ||
/// let client = new WebClient() | ||
/// client.AsyncDownloadData(Uri("https://www.microsoft.com")) |> Async.RunSynchronously |> System.Text.Encoding.ASCII.GetString |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise here, use https://www.w3.org/
src/fsharp/FSharp.Core/async.fsi
Outdated
/// <example id="async-download-file"> | ||
/// <code lang="fsharp"> | ||
/// let client = new System.Net.WebClient() | ||
/// System.Uri("https://www.microsoft.com") |> fun x -> client.AsyncDownloadFile(x, "output.html") |> Async.RunSynchronouslyl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise here, use https://www.w3.org/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, just a few small changes requested
@dsyme - Thank you for reviewing. I've updated the files. |
@dsyme --
Not sure if it's worth adding examples here because
WebClient
is deprecated in favor ofHttpClient
but I did it anyway.Please see FSharp.Control.Async.WebExtensions #12124