Skip to content

Instantly share code, notes, and snippets.

@gistlyn
Last active December 28, 2019 06:44
Show Gist options
  • Save gistlyn/a79893befd2c0fbbed8e92e7cc7aa28b to your computer and use it in GitHub Desktop.
Save gistlyn/a79893befd2c0fbbed8e92e7cc7aa28b to your computer and use it in GitHub Desktop.
ServiceStack F# gRPC Generic ServiceClient TodoWorld Example
open System
open System.Threading
open System.Threading.Tasks
open System.Security.Cryptography.X509Certificates
open ServiceStack
open TodoWorld.ServiceModel
open FSharp.Control.Tasks.V2
let todo () =
task {
let client = new GrpcServiceClient("https://todoworld.servicestack.net:50051",
new X509Certificate2("https://todoworld.servicestack.net/grpc.crt".GetBytesFromUrl()),
GrpcUtils.AllowSelfSignedCertificatesFrom("todoworld.servicestack.net"))
let! response = client.GetAsync(new Hello(Name = "gRPC F#"))
printfn "%s" response.Result
}
[<EntryPoint>]
let main argv =
todo().Wait()
0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment