get method

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

Implementation

Future<http.Response> get(
  String ip,
  String path, {
  Map<String, String>? headers,
}) async {
  final myIp = await _requireCurrentIp();

  final uri = Uri.parse('http://$ip$path');
  final binding = await DeviceRequestBindingModel.create(
    clientIp: myIp,
    serverIp: ip,
    method: 'GET',
    path: path,
  );

  return _engine.http.client.get(
    uri,
    headers: {
      ...?headers,
      DuneRequestHeaders.clientIp.key: myIp,
      ...binding.toHeaders(),
    },
  );
}