This is a n00b question, but I was thinking about trying a new library FSharp.Data 2.0.0-alpha6for the project that I have. In particular, I am trying to read JSON messages from a web service protected by basic HTTP authentication (username and password).
How can I go with JsonProvider(or any other provider) to read documents from a URL that is authorized by authorization, in this particular case using basic HTTP authentication?
Judging by the following SO questions, it looks like I should download the sample file separately:
But then after reading Gustavo ’s comment on F # News: Downloading stock prices gives hope that it will be possible.
Even if I had to download the sample file separately, how would I use JsonProviderto parse documents from resources that require basic HTTP authentication?
My minimum working sample
open System
open FSharp.Data
open FSharp.Data.JsonExtensions
type x1 = JsonProvider<"https://xyz.com/rest/v1/datanodes?&format=json">
[<EntryPoint>]
let main argv =
let x2 = new JsonProvider<"https://xyz.com/rest/v1/datanodes?&format=json">
0
Veksi source
share