get method

Future<Response> get(
  1. String ip,
  2. String path, {
  3. Map<String, String>? headers,
})
inherited

Implementation

Future<http.Response> get(
  String ip,
  String path, {
  Map<String, String>? headers,
}) async {
  final myIp = await client.getCurrentIp();
  if (myIp == null) {
    throw StateError('missing client IP');
  }

  final binding = await DeviceRequestBindingModel.create(
    clientIp: myIp,
    serverIp: ip,
    method: 'GET',
    path: path,
  );

  return client.get(ip, path, headers: {...?headers, ...binding.toHeaders()});
}