Last active
December 31, 2019 04:30
-
-
Save gistlyn/a420d1389e1a409c30399e9aaf286c03 to your computer and use it in GitHub Desktop.
C# Google protoc insecure GrpcServicesClient TodoWorld Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading.Tasks; | |
using Grpc.Core; | |
using Grpc.Net.Client; | |
namespace TodoWorld | |
{ | |
class Program | |
{ | |
static async Task Main(string[] args) | |
{ | |
AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true); | |
var client = new GrpcServices.GrpcServicesClient( | |
GrpcChannel.ForAddress("http://todoworld.servicestack.net:5054")); | |
var response = await client.GetHelloAsync(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