2020-01-26 00:57:02 +08:00
|
|
|
#region snippet_1
|
|
|
|
var handler = new GrpcWebHandler(GrpcWebMode.GrpcWebText, new HttpClientHandler());
|
|
|
|
var channel = GrpcChannel.ForAddress("https://localhost:5001", new GrpcChannelOptions
|
|
|
|
{
|
|
|
|
HttpClient = new HttpClient(handler)
|
|
|
|
});
|
|
|
|
|
2020-02-12 06:41:46 +08:00
|
|
|
var client = new Greeter.GreeterClient(channel);
|
|
|
|
var response = await client.SayHelloAsync(new HelloRequest { Name = ".NET" });
|
2020-01-26 00:57:02 +08:00
|
|
|
#endregion
|