Skip to content

Instantly share code, notes, and snippets.

Created October 24, 2021 11:39
What would you like to do?
open System.Net.Http
open System.Net.Http.Json
type Rate = { PLN: double }
type ApiResponse =
{ Amount: double
Base: string
Date: string
Rates: Rate }
let result =
async {
let client = new HttpClient()
let! result =
|> Async.AwaitTask
printfn $"10.99 in USD is {result.Rates.PLN} in PLN"
result |> Async.RunSynchronously
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment