【问题标题】:Easy question : Flutter mobile app using Grpc web to call grpc API简单问题:使用 Grpc web 调用 grpc API 的 Flutter 移动应用
【发布时间】:2021-09-26 04:06:45
【问题描述】:

尝试从我的 Flutter 手机调用 api(用 c# (GRPC) 编写):

 Future<void> login(email, password) async {
final stub = AuthenticationClient(ClientChannel('https://abc.service.domain.com'));

var request = LoginRequest()..email=email
                           ..password=password;
var response = await stub.login(request);
print(response);

}

GrpcError (gRPC Error (code: 14, codeName: UNAVAILABLE, message: Error connected: SocketException: Failed host lookup: 'https://abc.service.domain.com' (OS Error: No address associated with hostname, errno = 7),详细信息:null,rawResponse:null))。

已经设置/检查设备的互联网权限,并且已经有互联网。 检查服务是否正在运行,并且已在另一个应用程序中使用。

有什么想法吗?,

TIA。

【问题讨论】:

    标签: flutter api dart grpc http2


    【解决方案1】:

    尝试删除服务器域指示中的 https://。你只需要通过**abc.service.domain.com**

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-12-03
      • 2023-02-16
      • 1970-01-01
      • 1970-01-01
      • 2020-05-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多