Skip to content

Instantly share code, notes, and snippets.

@gistlyn
Last active December 28, 2019 08:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gistlyn/eaec1ae61bf2f481ff1197012163749a to your computer and use it in GitHub Desktop.
Save gistlyn/eaec1ae61bf2f481ff1197012163749a to your computer and use it in GitHub Desktop.
Insecure F# gRPC Generic ServiceClient TodoWorld Example
open System
open System.Threading
open System.Threading.Tasks
open ServiceStack
open TodoWorld.ServiceModel
open FSharp.Control.Tasks.V2
let todo () =
task {
ProtoBuf.Grpc.Client.GrpcClientFactory.AllowUnencryptedHttp2 <- true
let client = new GrpcServiceClient("http://todoworld.servicestack.net:5054")
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