Skip to content

Instantly share code, notes, and snippets.

@gistlyn
Created December 28, 2019 06:42
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/251a2ac77b84efeaeef264f982ee80eb to your computer and use it in GitHub Desktop.
Save gistlyn/251a2ac77b84efeaeef264f982ee80eb to your computer and use it in GitHub Desktop.
Insecure C# gRPC Generic ServiceClient TodoWorld Example
using System;
using System.Threading.Tasks;
using ServiceStack;
using TodoWorld.ServiceModel;
namespace TodoWorld
{
class Program
{
public static async Task Main(string[] args)
{
ProtoBuf.Grpc.Client.GrpcClientFactory.AllowUnencryptedHttp2 = true;
var client = new GrpcServiceClient("http://todoworld.servicestack.net:5054");
var response = await client.GetAsync(new Hello { Name = "gRPC C#" });
Console.WriteLine(response.Result);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment