How to consume HttpClient from F#?

后端 未结 5 1817
攒了一身酷
攒了一身酷 2021-02-20 04:13

I\'m new to F# and stuck in understanding async in F# from the perspective of a C# developer. Say having the following snippet in C#:



        
5条回答
  •  名媛妹妹
    2021-02-20 05:11

    You'll want to at least read and be aware of the established patterns in Http.fs if you're doing anything with HttpClient in F#.

    [See comments] TL;DR ... but Beware the Share. As noted by @pimbrouwers, it should be noted that you don't necessarily have to then use it though - subsetting and/or evolving your own set of helpers in your context can lead you to a better fitting abstraction (and bring you the benefits of the learning on the way).

    To this point: It's considered idiomatic practice in F# to keep rarely used and/or overly specific helpers in a non-central location.

提交回复
热议问题