예제 #1
0
        public async Task <IActionResult> SayHelloAsync(string name)
        {
            var content = new StringBuilder();
            var message = await _greeter.SayHelloAsync(name);

            content.AppendLine($"from frontend grpc message:{message}");

            var response = await new HttpClient().GetStringAsync("http://localhost:5002/api/values");

            content.AppendLine($"from frontend httpclient message:{response}");

            response = await new HttpClient().GetStringAsync($"http://localhost:5002/api/grpc/greeter?name={name}");
            content.AppendLine(response);

            return(Ok(content));
        }
예제 #2
0
        public async Task <IActionResult> SayHelloAsync(string name)
        {
            var reply = await _greeter.SayHelloAsync(name);

            return(Ok($"from backend grpc message{reply}"));
        }